diff --git a/.github/workflows/cd-core.yaml b/.github/workflows/cd-core.yaml index 5ddc04f7c4..bbcdbf7793 100644 --- a/.github/workflows/cd-core.yaml +++ b/.github/workflows/cd-core.yaml @@ -10,6 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: yarn --ignore-scripts name: Install dependencies - run: yarn build diff --git a/.github/workflows/cd-deploy-contracts.yaml b/.github/workflows/cd-deploy-contracts.yaml index cd70acca2b..f12b081415 100644 --- a/.github/workflows/cd-deploy-contracts.yaml +++ b/.github/workflows/cd-deploy-contracts.yaml @@ -35,6 +35,9 @@ jobs: - uses: actions/checkout@v4 with: token: ${{ secrets.GH_TOKEN_CD_CONTRACTS }} + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - name: Install dependencies run: npm install --global yarn && yarn --ignore-scripts - run: yarn build diff --git a/.github/workflows/cd-node-sdk.yaml b/.github/workflows/cd-node-sdk.yaml index aac29bc202..7e9664a9dc 100644 --- a/.github/workflows/cd-node-sdk.yaml +++ b/.github/workflows/cd-node-sdk.yaml @@ -15,6 +15,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: yarn --ignore-scripts name: Install dependencies - run: yarn build diff --git a/.github/workflows/cd-subgraph.yaml b/.github/workflows/cd-subgraph.yaml index d8858b1e56..caa0051435 100644 --- a/.github/workflows/cd-subgraph.yaml +++ b/.github/workflows/cd-subgraph.yaml @@ -30,7 +30,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '18.20.1' + node-version-file: .nvmrc - name: Filter Networks id: filter_networks run: | diff --git a/.github/workflows/ci-lint.yaml b/.github/workflows/ci-lint.yaml index e1c6a9e900..7b4aa086c1 100644 --- a/.github/workflows/ci-lint.yaml +++ b/.github/workflows/ci-lint.yaml @@ -13,6 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn name: Install dependencies - run: yarn lint diff --git a/.github/workflows/ci-test-core.yaml b/.github/workflows/ci-test-core.yaml index 11c85a8274..1b88a8c06b 100644 --- a/.github/workflows/ci-test-core.yaml +++ b/.github/workflows/ci-test-core.yaml @@ -15,6 +15,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn --ignore-scripts name: Install dependencies - run: yarn workspace @human-protocol/core test diff --git a/.github/workflows/ci-test-cvat-recording-oracle.yaml b/.github/workflows/ci-test-cvat-recording-oracle.yaml index 638d0019f4..7b558d982e 100644 --- a/.github/workflows/ci-test-cvat-recording-oracle.yaml +++ b/.github/workflows/ci-test-cvat-recording-oracle.yaml @@ -4,7 +4,7 @@ on: push: paths: - 'packages/examples/cvat/recording-oracle/**' - - 'packages/sdk/python/human-protocol-sdk/**' + - 'packages/core/**' jobs: cvat-exo-test: diff --git a/.github/workflows/ci-test-dashboard.yaml b/.github/workflows/ci-test-dashboard.yaml index f9f654b227..39a38a767d 100644 --- a/.github/workflows/ci-test-dashboard.yaml +++ b/.github/workflows/ci-test-dashboard.yaml @@ -17,6 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn name: Install dependencies - run: yarn workspace @human-protocol/dashboard-server test diff --git a/.github/workflows/ci-test-faucet-server.yaml b/.github/workflows/ci-test-faucet-server.yaml index d252d7a4b0..d52fcc56bb 100644 --- a/.github/workflows/ci-test-faucet-server.yaml +++ b/.github/workflows/ci-test-faucet-server.yaml @@ -17,6 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn name: Install dependencies - run: cp .env.example .env diff --git a/.github/workflows/ci-test-fortune.yaml b/.github/workflows/ci-test-fortune.yaml index 415416116a..3b361ef475 100644 --- a/.github/workflows/ci-test-fortune.yaml +++ b/.github/workflows/ci-test-fortune.yaml @@ -17,6 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn name: Install dependencies - run: yarn workspace @human-protocol/fortune-exchange-oracle-server test diff --git a/.github/workflows/ci-test-human-app.yaml b/.github/workflows/ci-test-human-app.yaml index 126e507d2f..9fb8396dda 100644 --- a/.github/workflows/ci-test-human-app.yaml +++ b/.github/workflows/ci-test-human-app.yaml @@ -17,6 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn name: Install dependencies - run: yarn workspace @human-protocol/human-app-server test diff --git a/.github/workflows/ci-test-job-launcher.yaml b/.github/workflows/ci-test-job-launcher.yaml index a7c6a19899..b1bdd44d21 100644 --- a/.github/workflows/ci-test-job-launcher.yaml +++ b/.github/workflows/ci-test-job-launcher.yaml @@ -17,6 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn name: Install dependencies - run: yarn workspace @human-protocol/job-launcher-client test diff --git a/.github/workflows/ci-test-node-sdk.yaml b/.github/workflows/ci-test-node-sdk.yaml index e51bd1127b..93a89709c2 100644 --- a/.github/workflows/ci-test-node-sdk.yaml +++ b/.github/workflows/ci-test-node-sdk.yaml @@ -16,6 +16,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn --ignore-scripts name: Install dependencies - run: yarn build diff --git a/.github/workflows/ci-test-reputation-oracle.yaml b/.github/workflows/ci-test-reputation-oracle.yaml index 593f21ed09..ccaacf1e5d 100644 --- a/.github/workflows/ci-test-reputation-oracle.yaml +++ b/.github/workflows/ci-test-reputation-oracle.yaml @@ -17,6 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn name: Install dependencies - run: yarn workspace @human-protocol/reputation-oracle test diff --git a/.github/workflows/ci-test-subgraph.yaml b/.github/workflows/ci-test-subgraph.yaml index a48cba94a0..700ed3db95 100644 --- a/.github/workflows/ci-test-subgraph.yaml +++ b/.github/workflows/ci-test-subgraph.yaml @@ -17,6 +17,9 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc - run: npm install --global yarn && yarn name: Install dependencies - run: yarn workspace @human-protocol/subgraph test diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..f3c67fcf74 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.14 \ No newline at end of file diff --git a/docs/sdk/python/human_protocol_sdk.constants.md b/docs/sdk/python/human_protocol_sdk.constants.md index aa04bfb891..f93dcb051f 100644 --- a/docs/sdk/python/human_protocol_sdk.constants.md +++ b/docs/sdk/python/human_protocol_sdk.constants.md @@ -50,11 +50,11 @@ Enum for KVStore keys #### website *= 'website'* -### *class* human_protocol_sdk.constants.LeaderCategory(value) +### *class* human_protocol_sdk.constants.OperatorCategory(value) Bases: `Enum` -Enum for leader categories +Enum for operator categories #### MACHINE_LEARNING *= 'machine_learning'* @@ -76,13 +76,13 @@ Bases: `Enum` Enum for roles. -#### exchange_oracle *= 'Exchange Oracle'* +#### exchange_oracle *= 'exchange_oracle'* -#### job_launcher *= 'Job Launcher'* +#### job_launcher *= 'job_launcher'* -#### recording_oracle *= 'Recording Oracle'* +#### recording_oracle *= 'recording_oracle'* -#### reputation_oracle *= 'Reputation Oracle'* +#### reputation_oracle *= 'reputation_oracle'* ### *class* human_protocol_sdk.constants.Status(value) 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 3ad628a9ea..86d1fd9559 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md @@ -14,7 +14,7 @@ as well as some middlewares. ```python from eth_typing import URI from web3 import Web3 -from web3.middleware import construct_sign_and_send_raw_middleware +from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -23,9 +23,10 @@ def get_w3_with_priv_key(priv_key: str): w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -91,7 +92,7 @@ Adds an array of addresses to the trusted handlers list. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -100,9 +101,10 @@ Adds an array of addresses to the trusted handlers list. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -142,7 +144,7 @@ Pays out the amounts specified to the workers and sets the URL of the final resu ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -151,9 +153,10 @@ Pays out the amounts specified to the workers and sets the URL of the final resu w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -202,7 +205,7 @@ Cancels the specified escrow and sends the balance to the canceler. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -211,9 +214,10 @@ Cancels the specified escrow and sends the balance to the canceler. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -242,7 +246,7 @@ Sets the status of an escrow to completed. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -251,9 +255,10 @@ Sets the status of an escrow to completed. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -285,7 +290,7 @@ Creates a prepared transaction for bulk payout without signing or sending it. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -294,9 +299,10 @@ Creates a prepared transaction for bulk payout without signing or sending it. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -354,7 +360,7 @@ Creates a new escrow contract. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -364,9 +370,10 @@ Creates a new escrow contract. URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -421,7 +428,7 @@ Adds funds to the escrow. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -430,9 +437,10 @@ Adds funds to the escrow. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -793,7 +801,7 @@ Sets up the parameters of the escrow. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -803,9 +811,10 @@ Sets up the parameters of the escrow. URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -853,7 +862,7 @@ Stores the results URL. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -862,9 +871,10 @@ Stores the results URL. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -900,7 +910,7 @@ Withdraws additional tokens in the escrow to the canceler. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.escrow import EscrowClient @@ -909,9 +919,10 @@ Withdraws additional tokens in the escrow to the canceler. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) 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 a59d98e5cd..4c9cc4767f 100644 --- a/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_client.md +++ b/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_client.md @@ -14,7 +14,7 @@ as well as some middlewares. ```python from eth_typing import URI from web3 import Web3 -from web3.middleware import construct_sign_and_send_raw_middleware +from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.kvstore import KVStoreClient @@ -23,9 +23,10 @@ def get_w3_with_priv_key(priv_key: str): w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -78,7 +79,7 @@ Sets the value of a key-value pair in the contract. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.kvstore import KVStoreClient @@ -87,9 +88,10 @@ Sets the value of a key-value pair in the contract. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -114,7 +116,7 @@ Sets multiple key-value pairs in the contract. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.kvstore import KVStoreClient @@ -123,9 +125,10 @@ Sets multiple key-value pairs in the contract. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -155,7 +158,7 @@ Sets a URL value for the address that submits the transaction, and its hash. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.kvstore import KVStoreClient @@ -164,9 +167,10 @@ Sets a URL value for the address that submits the transaction, and its hash. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) diff --git a/docs/sdk/python/human_protocol_sdk.md b/docs/sdk/python/human_protocol_sdk.md index dbe51d876a..23fa99ab62 100644 --- a/docs/sdk/python/human_protocol_sdk.md +++ b/docs/sdk/python/human_protocol_sdk.md @@ -64,9 +64,8 @@ * [human_protocol_sdk.operator.operator_utils module](human_protocol_sdk.operator.operator_utils.md) * [Code Example](human_protocol_sdk.operator.operator_utils.md#code-example) * [Module](human_protocol_sdk.operator.operator_utils.md#module) - * [`LeaderData`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.LeaderData) - * [`LeaderFilter`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.LeaderFilter) - * [`Operator`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.Operator) + * [`OperatorData`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorData) + * [`OperatorFilter`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorFilter) * [`OperatorUtils`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtils) * [`OperatorUtilsError`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtilsError) * [`RewardData`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.RewardData) @@ -139,9 +138,9 @@ * [`KVStoreKeys.url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.url) * [`KVStoreKeys.webhook_url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.webhook_url) * [`KVStoreKeys.website`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.website) - * [`LeaderCategory`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory) - * [`LeaderCategory.MACHINE_LEARNING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory.MACHINE_LEARNING) - * [`LeaderCategory.MARKET_MAKING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory.MARKET_MAKING) + * [`OperatorCategory`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OperatorCategory) + * [`OperatorCategory.MACHINE_LEARNING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OperatorCategory.MACHINE_LEARNING) + * [`OperatorCategory.MARKET_MAKING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OperatorCategory.MARKET_MAKING) * [`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection) * [`OrderDirection.ASC`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection.ASC) * [`OrderDirection.DESC`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection.DESC) diff --git a/docs/sdk/python/human_protocol_sdk.operator.md b/docs/sdk/python/human_protocol_sdk.operator.md index 221784ef4c..7dd40a95c2 100644 --- a/docs/sdk/python/human_protocol_sdk.operator.md +++ b/docs/sdk/python/human_protocol_sdk.operator.md @@ -8,15 +8,13 @@ obtain staking information from both the contracts and subgraph. * [human_protocol_sdk.operator.operator_utils module](human_protocol_sdk.operator.operator_utils.md) * [Code Example](human_protocol_sdk.operator.operator_utils.md#code-example) * [Module](human_protocol_sdk.operator.operator_utils.md#module) - * [`LeaderData`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.LeaderData) - * [`LeaderData.__init__()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.LeaderData.__init__) - * [`LeaderFilter`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.LeaderFilter) - * [`LeaderFilter.__init__()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.LeaderFilter.__init__) - * [`Operator`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.Operator) - * [`Operator.__init__()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.Operator.__init__) + * [`OperatorData`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorData) + * [`OperatorData.__init__()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorData.__init__) + * [`OperatorFilter`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorFilter) + * [`OperatorFilter.__init__()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorFilter.__init__) * [`OperatorUtils`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtils) - * [`OperatorUtils.get_leader()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtils.get_leader) - * [`OperatorUtils.get_leaders()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtils.get_leaders) + * [`OperatorUtils.get_operator()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtils.get_operator) + * [`OperatorUtils.get_operators()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtils.get_operators) * [`OperatorUtils.get_reputation_network_operators()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtils.get_reputation_network_operators) * [`OperatorUtils.get_rewards_info()`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtils.get_rewards_info) * [`OperatorUtilsError`](human_protocol_sdk.operator.operator_utils.md#human_protocol_sdk.operator.operator_utils.OperatorUtilsError) 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 1200f47d0d..a415b09ff3 100644 --- a/docs/sdk/python/human_protocol_sdk.operator.operator_utils.md +++ b/docs/sdk/python/human_protocol_sdk.operator.operator_utils.md @@ -6,24 +6,24 @@ Utility class for operator-related operations. ```python from human_protocol_sdk.constants import ChainId -from human_protocol_sdk.operator import OperatorUtils, LeaderFilter +from human_protocol_sdk.operator import OperatorUtils, OperatorFilter print( - OperatorUtils.get_leaders( - LeaderFilter(chain_id=ChainId.POLYGON_AMOY, roles=["Job Launcher"]) + OperatorUtils.get_operators( + OperatorFilter(chain_id=ChainId.POLYGON_AMOY, roles=["Job Launcher"]) ) ) ``` ## Module -### *class* human_protocol_sdk.operator.operator_utils.LeaderData(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, name=None, category=None) +### *class* human_protocol_sdk.operator.operator_utils.OperatorData(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, name=None, category=None) 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, name=None, category=None) -Initializes a LeaderData instance. +Initializes a OperatorData instance. * **Parameters:** * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Chain Identifier @@ -49,15 +49,15 @@ Initializes a LeaderData instance. * **name** (`Optional`[`str`]) – Name * **category** (`Optional`[`str`]) – Category -### *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) +### *class* human_protocol_sdk.operator.operator_utils.OperatorFilter(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. +A class used to filter operators. #### \_\_init_\_(chain_id, roles=[], min_amount_staked=None, order_by=None, order_direction=OrderDirection.DESC, first=10, skip=0) -Initializes a LeaderFilter instance. +Initializes a OperatorFilter instance. * **Parameters:** * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Chain ID to request data @@ -68,69 +68,53 @@ Initializes a LeaderFilter instance. * **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) - -Bases: `object` - -#### \_\_init_\_(address, role, url='', job_types=[], registration_needed=None, registration_instructions=None) - -Initializes an Operator instance. - -* **Parameters:** - * **address** (`str`) – Operator address - * **role** (`str`) – Role of the operator - * **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 Bases: `object` A utility class that provides additional operator-related functionalities. -#### *static* get_leader(chain_id, leader_address) +#### *static* get_operator(chain_id, operator_address) -Gets the leader details. +Gets the operator details. * **Parameters:** - * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network in which the leader exists - * **leader_address** (`str`) – Address of the leader + * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network in which the operator exists + * **operator_address** (`str`) – Address of the operator * **Return type:** - `Optional`[[`LeaderData`](#human_protocol_sdk.operator.operator_utils.LeaderData)] + `Optional`[[`OperatorData`](#human_protocol_sdk.operator.operator_utils.OperatorData)] * **Returns:** - Leader data if exists, otherwise None + Operator data if exists, otherwise None * **Example:** ```python from human_protocol_sdk.constants import ChainId from human_protocol_sdk.operator import OperatorUtils chain_id = ChainId.POLYGON_AMOY - leader_address = '0x62dD51230A30401C455c8398d06F85e4EaB6309f' + operator_address = '0x62dD51230A30401C455c8398d06F85e4EaB6309f' - leader_data = OperatorUtils.get_leader(chain_id, leader_address) - print(leader_data) + operator_data = OperatorUtils.get_operator(chain_id, operator_address) + print(operator_data) ``` -#### *static* get_leaders(filter) +#### *static* get_operators(filter) -Get leaders data of the protocol. +Get operators data of the protocol. * **Parameters:** - **filter** ([`LeaderFilter`](#human_protocol_sdk.operator.operator_utils.LeaderFilter)) – Leader filter + **filter** ([`OperatorFilter`](#human_protocol_sdk.operator.operator_utils.OperatorFilter)) – Operator filter * **Return type:** - `List`[[`LeaderData`](#human_protocol_sdk.operator.operator_utils.LeaderData)] + `List`[[`OperatorData`](#human_protocol_sdk.operator.operator_utils.OperatorData)] * **Returns:** - List of leaders data + List of operators data * **Example:** ```python from human_protocol_sdk.constants import ChainId - from human_protocol_sdk.operator import OperatorUtils, LeaderFilter + from human_protocol_sdk.operator import OperatorUtils, OperatorFilter print( - OperatorUtils.get_leaders( - LeaderFilter(chain_id=ChainId.POLYGON_AMOY, roles=["Job Launcher"]) + OperatorUtils.get_operators( + OperatorFilter(chain_id=ChainId.POLYGON_AMOY, roles=["Job Launcher"]) ) ) ``` @@ -144,7 +128,7 @@ Get the reputation network operators of the specified address. * **address** (`str`) – Address of the reputation oracle * **role** (`Optional`[`str`]) – (Optional) Role of the operator * **Return type:** - `List`[[`Operator`](#human_protocol_sdk.operator.operator_utils.Operator)] + `List`[[`OperatorData`](#human_protocol_sdk.operator.operator_utils.OperatorData)] * **Returns:** Returns an array of operator details * **Example:** 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 2435cb066d..e0a9fbc526 100644 --- a/docs/sdk/python/human_protocol_sdk.staking.staking_client.md +++ b/docs/sdk/python/human_protocol_sdk.staking.staking_client.md @@ -14,7 +14,7 @@ as well as some middlewares. ```python from eth_typing import URI from web3 import Web3 -from web3.middleware import construct_sign_and_send_raw_middleware +from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.staking import StakingClient @@ -23,9 +23,10 @@ def get_w3_with_priv_key(priv_key: str): w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -78,7 +79,7 @@ Approves HMT token for Staking. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.staking import StakingClient @@ -87,9 +88,10 @@ Approves HMT token for Staking. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -149,7 +151,7 @@ Slashes HMT token. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.staking import StakingClient @@ -158,9 +160,10 @@ Slashes HMT token. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -195,7 +198,7 @@ Stakes HMT token. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.staking import StakingClient @@ -204,9 +207,10 @@ Stakes HMT token. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -236,7 +240,7 @@ Unstakes HMT token. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.staking import StakingClient @@ -245,9 +249,10 @@ Unstakes HMT token. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) @@ -274,7 +279,7 @@ Withdraws HMT token. ```python from eth_typing import URI from web3 import Web3 - from web3.middleware import construct_sign_and_send_raw_middleware + from web3.middleware import SignAndSendRawMiddlewareBuilder from web3.providers.auto import load_provider_from_uri from human_protocol_sdk.staking import StakingClient @@ -283,9 +288,10 @@ Withdraws HMT token. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) gas_payer = w3.eth.account.from_key(priv_key) w3.eth.default_account = gas_payer.address - w3.middleware_onion.add( - construct_sign_and_send_raw_middleware(gas_payer), - "construct_sign_and_send_raw_middleware", + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(priv_key), + 'SignAndSendRawMiddlewareBuilder', + layer=0, ) return (w3, gas_payer) diff --git a/docs/sdk/python/index.md b/docs/sdk/python/index.md index 08dc3fd4e2..950c44c068 100644 --- a/docs/sdk/python/index.md +++ b/docs/sdk/python/index.md @@ -46,7 +46,7 @@ pip install human-protocol-sdk[agreement] * [human_protocol_sdk.constants module](human_protocol_sdk.constants.md) * [`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId) * [`KVStoreKeys`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys) - * [`LeaderCategory`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory) + * [`OperatorCategory`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OperatorCategory) * [`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection) * [`Role`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Role) * [`Status`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status) diff --git a/docs/sdk/typescript/base/README.md b/docs/sdk/typescript/base/README.md index 6cf08fb2ef..75875daaf1 100644 --- a/docs/sdk/typescript/base/README.md +++ b/docs/sdk/typescript/base/README.md @@ -6,8 +6,6 @@ # base -## Index - -### Classes +## Classes - [BaseEthersClient](classes/BaseEthersClient.md) diff --git a/docs/sdk/typescript/base/classes/BaseEthersClient.md b/docs/sdk/typescript/base/classes/BaseEthersClient.md index 1498d643bb..4487e3c0cb 100644 --- a/docs/sdk/typescript/base/classes/BaseEthersClient.md +++ b/docs/sdk/typescript/base/classes/BaseEthersClient.md @@ -6,6 +6,8 @@ # Class: `abstract` BaseEthersClient +Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) + ## Introduction This class is used as a base class for other clients making on-chain calls. @@ -22,6 +24,8 @@ This class is used as a base class for other clients making on-chain calls. > **new BaseEthersClient**(`runner`, `networkData`): [`BaseEthersClient`](BaseEthersClient.md) +Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) + **BaseClient constructor** #### Parameters @@ -42,19 +46,13 @@ The network information required to connect to the contracts [`BaseEthersClient`](BaseEthersClient.md) -#### Defined in - -[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) - ## Properties ### networkData > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -#### Defined in - -[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -62,6 +60,4 @@ The network information required to connect to the contracts > `protected` **runner**: `ContractRunner` -#### Defined in - -[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) diff --git a/docs/sdk/typescript/encryption/README.md b/docs/sdk/typescript/encryption/README.md index 428b9d1e11..ca6e9bf8d7 100644 --- a/docs/sdk/typescript/encryption/README.md +++ b/docs/sdk/typescript/encryption/README.md @@ -6,9 +6,7 @@ # encryption -## Index - -### Classes +## Classes - [Encryption](classes/Encryption.md) - [EncryptionUtils](classes/EncryptionUtils.md) diff --git a/docs/sdk/typescript/encryption/classes/Encryption.md b/docs/sdk/typescript/encryption/classes/Encryption.md index ad497bc785..8b4e009617 100644 --- a/docs/sdk/typescript/encryption/classes/Encryption.md +++ b/docs/sdk/typescript/encryption/classes/Encryption.md @@ -6,6 +6,8 @@ # Class: Encryption +Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) + ## Introduction Class for signing and decrypting messages. @@ -51,6 +53,8 @@ const encryption = await Encryption.build(privateKey, passphrase); > **new Encryption**(`privateKey`): [`Encryption`](Encryption.md) +Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) + Constructor for the Encryption class. #### Parameters @@ -65,16 +69,14 @@ The private key. [`Encryption`](Encryption.md) -#### Defined in - -[encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) - ## Methods ### decrypt() > **decrypt**(`message`, `publicKey`?): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> +Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) + This function decrypts messages using the private key. In addition, the public key can be added for signature verification. #### Parameters @@ -121,16 +123,14 @@ UYLqAQDfdym4kiUvKO1+REKASt0Gwykndl7hra9txqlUL5DXBQ===Vwgv const resultMessage = await encryption.decrypt('message'); ``` -#### Defined in - -[encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) - *** ### sign() > **sign**(`message`): `Promise`\<`string`\> +Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) + This function signs a message using the private key used to initialize the client. #### Parameters @@ -159,16 +159,14 @@ const encryption = await Encryption.build(privateKey, passphrase); const resultMessage = await encryption.sign('message'); ``` -#### Defined in - -[encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) - *** ### signAndEncrypt() > **signAndEncrypt**(`message`, `publicKeys`): `Promise`\<`string`\> +Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) + This function signs and encrypts a message using the private key used to initialize the client and the specified public keys. #### Parameters @@ -228,16 +226,14 @@ const publicKeys = [publicKey1, publicKey2]; const resultMessage = await encryption.signAndEncrypt('message', publicKeys); ``` -#### Defined in - -[encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) - *** ### build() > `static` **build**(`privateKeyArmored`, `passphrase`?): `Promise`\<[`Encryption`](Encryption.md)\> +Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) + Builds an Encryption instance by decrypting the private key from an encrypted private key and passphrase. #### Parameters @@ -259,7 +255,3 @@ Optional: The passphrase for the private key. `Promise`\<[`Encryption`](Encryption.md)\> - The Encryption instance. - -#### Defined in - -[encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 792fdc1c3a..9e02dcd753 100644 --- a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md +++ b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md @@ -6,6 +6,8 @@ # Class: EncryptionUtils +Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) + ## Introduction Utility class for encryption-related operations. @@ -46,6 +48,8 @@ const keyPair = await EncryptionUtils.generateKeyPair('Human', 'human@hmt.ai'); > `static` **encrypt**(`message`, `publicKeys`): `Promise`\<`string`\> +Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) + This function encrypts a message using the specified public keys. #### Parameters @@ -101,16 +105,14 @@ const publicKeys = [publicKey1, publicKey2] const result = await EncryptionUtils.encrypt('message', publicKeys); ``` -#### Defined in - -[encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) - *** ### generateKeyPair() > `static` **generateKeyPair**(`name`, `email`, `passphrase`): `Promise`\<[`IKeyPair`](../../interfaces/interfaces/IKeyPair.md)\> +Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) + This function generates a key pair for encryption and decryption. #### Parameters @@ -150,16 +152,14 @@ const passphrase = 'YOUR_PASSPHRASE'; const result = await EncryptionUtils.generateKeyPair(name, email, passphrase); ``` -#### Defined in - -[encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) - *** ### getSignedData() > `static` **getSignedData**(`message`): `Promise`\<`string`\> +Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) + This function gets signed data from a signed message. #### Parameters @@ -184,16 +184,14 @@ import { EncryptionUtils } from '@human-protocol/sdk'; const signedData = await EncryptionUtils.getSignedData('message'); ``` -#### Defined in - -[encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) - *** ### isEncrypted() > `static` **isEncrypted**(`message`): `boolean` +Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) + Verifies if a message appears to be encrypted with OpenPGP. #### Parameters @@ -234,16 +232,14 @@ if (isEncrypted) { } ``` -#### Defined in - -[encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) - *** ### verify() > `static` **verify**(`message`, `publicKey`): `Promise`\<`boolean`\> +Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) + This function verifies the signature of a signed message using the public key. #### Parameters @@ -285,7 +281,3 @@ UYLqAQDfdym4kiUvKO1+REKASt0Gwykndl7hra9txqlUL5DXBQ===Vwgv const result = await EncryptionUtils.verify('message', publicKey); ``` - -#### Defined in - -[encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) diff --git a/docs/sdk/typescript/enums/README.md b/docs/sdk/typescript/enums/README.md index a24fdec353..fde5e39c53 100644 --- a/docs/sdk/typescript/enums/README.md +++ b/docs/sdk/typescript/enums/README.md @@ -6,10 +6,8 @@ # enums -## Index - -### Enumerations +## Enumerations - [ChainId](enumerations/ChainId.md) -- [LeaderCategory](enumerations/LeaderCategory.md) +- [OperatorCategory](enumerations/OperatorCategory.md) - [OrderDirection](enumerations/OrderDirection.md) diff --git a/docs/sdk/typescript/enums/enumerations/ChainId.md b/docs/sdk/typescript/enums/enumerations/ChainId.md index 1efccc3645..fc57b00227 100644 --- a/docs/sdk/typescript/enums/enumerations/ChainId.md +++ b/docs/sdk/typescript/enums/enumerations/ChainId.md @@ -6,15 +6,15 @@ # Enumeration: ChainId +Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) + ## Enumeration Members ### ALL > **ALL**: `-1` -#### Defined in - -[enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) +Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) *** @@ -22,9 +22,7 @@ > **BSC\_MAINNET**: `56` -#### Defined in - -[enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) +Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) *** @@ -32,9 +30,7 @@ > **BSC\_TESTNET**: `97` -#### Defined in - -[enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) +Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) *** @@ -42,9 +38,7 @@ > **LOCALHOST**: `1338` -#### Defined in - -[enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) +Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) *** @@ -52,9 +46,7 @@ > **MAINNET**: `1` -#### Defined in - -[enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) +Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) *** @@ -62,9 +54,7 @@ > **POLYGON**: `137` -#### Defined in - -[enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) +Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) *** @@ -72,9 +62,7 @@ > **POLYGON\_AMOY**: `80002` -#### Defined in - -[enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) +Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) *** @@ -82,6 +70,4 @@ > **SEPOLIA**: `11155111` -#### Defined in - -[enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) +Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) diff --git a/docs/sdk/typescript/enums/enumerations/LeaderCategory.md b/docs/sdk/typescript/enums/enumerations/LeaderCategory.md deleted file mode 100644 index 0d9fb3b66f..0000000000 --- a/docs/sdk/typescript/enums/enumerations/LeaderCategory.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@human-protocol/sdk**](../../README.md) - -*** - -[@human-protocol/sdk](../../modules.md) / [enums](../README.md) / LeaderCategory - -# Enumeration: LeaderCategory - -## Enumeration Members - -### MACHINE\_LEARNING - -> **MACHINE\_LEARNING**: `"machine_learning"` - -#### Defined in - -[enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) - -*** - -### MARKET\_MAKING - -> **MARKET\_MAKING**: `"market_making"` - -#### Defined in - -[enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) diff --git a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md new file mode 100644 index 0000000000..db2feb91a4 --- /dev/null +++ b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md @@ -0,0 +1,25 @@ +[**@human-protocol/sdk**](../../README.md) + +*** + +[@human-protocol/sdk](../../modules.md) / [enums](../README.md) / OperatorCategory + +# Enumeration: OperatorCategory + +Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) + +## Enumeration Members + +### MACHINE\_LEARNING + +> **MACHINE\_LEARNING**: `"machine_learning"` + +Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) + +*** + +### MARKET\_MAKING + +> **MARKET\_MAKING**: `"market_making"` + +Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) diff --git a/docs/sdk/typescript/enums/enumerations/OrderDirection.md b/docs/sdk/typescript/enums/enumerations/OrderDirection.md index 84c990770b..a78e620292 100644 --- a/docs/sdk/typescript/enums/enumerations/OrderDirection.md +++ b/docs/sdk/typescript/enums/enumerations/OrderDirection.md @@ -6,15 +6,15 @@ # Enumeration: OrderDirection +Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) + ## Enumeration Members ### ASC > **ASC**: `"asc"` -#### Defined in - -[enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) +Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) *** @@ -22,6 +22,4 @@ > **DESC**: `"desc"` -#### Defined in - -[enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) +Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) diff --git a/docs/sdk/typescript/escrow/README.md b/docs/sdk/typescript/escrow/README.md index bace86f7e8..0d8dc6fd93 100644 --- a/docs/sdk/typescript/escrow/README.md +++ b/docs/sdk/typescript/escrow/README.md @@ -6,9 +6,7 @@ # escrow -## Index - -### Classes +## Classes - [EscrowClient](classes/EscrowClient.md) - [EscrowUtils](classes/EscrowUtils.md) diff --git a/docs/sdk/typescript/escrow/classes/EscrowClient.md b/docs/sdk/typescript/escrow/classes/EscrowClient.md index 435f315547..9a27e2ca4e 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowClient.md +++ b/docs/sdk/typescript/escrow/classes/EscrowClient.md @@ -6,6 +6,8 @@ # Class: EscrowClient +Defined in: [escrow.ts:134](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L134) + ## Introduction This client enables performing actions on Escrow contracts and obtaining information from both the contracts and subgraph. @@ -84,6 +86,8 @@ const escrowClient = await EscrowClient.build(provider); > **new EscrowClient**(`runner`, `networkData`): [`EscrowClient`](EscrowClient.md) +Defined in: [escrow.ts:143](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L143) + **EscrowClient constructor** #### Parameters @@ -108,23 +112,17 @@ The network information required to connect to the Escrow contract [`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) -#### Defined in - -[escrow.ts:143](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L143) - ## Properties ### networkData > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -#### Inherited from - -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) -#### Defined in +#### Inherited from -[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) *** @@ -132,13 +130,11 @@ The network information required to connect to the Escrow contract > `protected` **runner**: `ContractRunner` -#### Inherited from +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) - -#### Defined in +#### Inherited from -[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) ## Methods @@ -146,6 +142,8 @@ The network information required to connect to the Escrow contract > **addTrustedHandlers**(`escrowAddress`, `trustedHandlers`, `txOptions`?): `Promise`\<`void`\> +Defined in: [escrow.ts:771](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L771) + This function adds an array of addresses to the trusted handlers list. #### Parameters @@ -193,16 +191,14 @@ const trustedHandlers = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6 await escrowClient.addTrustedHandlers('0x62dD51230A30401C455c8398d06F85e4EaB6309f', trustedHandlers); ``` -#### Defined in - -[escrow.ts:771](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L771) - *** ### bulkPayOut() > **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions`?): `Promise`\<`void`\> +Defined in: [escrow.ts:604](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L604) + This function pays out the amounts specified to the workers and sets the URL of the final results file. #### Parameters @@ -285,16 +281,14 @@ const txId = 1; await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', recipients, amounts, resultsUrl, resultsHash, txId); ``` -#### Defined in - -[escrow.ts:604](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L604) - *** ### cancel() > **cancel**(`escrowAddress`, `txOptions`?): `Promise`\<[`EscrowCancel`](../../types/type-aliases/EscrowCancel.md)\> +Defined in: [escrow.ts:685](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L685) + This function cancels the specified escrow and sends the balance to the canceler. #### Parameters @@ -335,16 +329,14 @@ const escrowClient = await EscrowClient.build(signer); await escrowClient.cancel('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:685](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L685) - *** ### complete() > **complete**(`escrowAddress`, `txOptions`?): `Promise`\<`void`\> +Defined in: [escrow.ts:543](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L543) + This function sets the status of an escrow to completed. #### Parameters @@ -385,16 +377,14 @@ const escrowClient = await EscrowClient.build(signer); await escrowClient.complete('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:543](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L543) - *** ### createBulkPayoutTransaction() > **createBulkPayoutTransaction**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions`?): `Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> +Defined in: [escrow.ts:940](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L940) + Creates a prepared transaction for bulk payout without immediately sending it. #### Parameters @@ -481,16 +471,14 @@ const signedTransaction = await signer.signTransaction(rawTransaction); console.log('Tx hash:', ethers.keccak256(signedTransaction)); (await signer.sendTransaction(rawTransaction)).wait(); -#### Defined in - -[escrow.ts:940](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L940) - *** ### createEscrow() > **createEscrow**(`tokenAddress`, `trustedHandlers`, `jobRequesterId`, `txOptions`?): `Promise`\<`string`\> +Defined in: [escrow.ts:223](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L223) + This function creates an escrow contract that uses the token passed to pay oracle fees and reward workers. #### Parameters @@ -546,16 +534,14 @@ const jobRequesterId = "job-requester-id"; const escrowAddress = await escrowClient.createEscrow(tokenAddress, trustedHandlers, jobRequesterId); ``` -#### Defined in - -[escrow.ts:223](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L223) - *** ### fund() > **fund**(`escrowAddress`, `amount`, `txOptions`?): `Promise`\<`void`\> +Defined in: [escrow.ts:414](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L414) + This function adds funds of the chosen token to the escrow. #### Parameters @@ -601,16 +587,14 @@ const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI await escrowClient.fund('0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount); ``` -#### Defined in - -[escrow.ts:414](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L414) - *** ### getBalance() > **getBalance**(`escrowAddress`): `Promise`\<`bigint`\> +Defined in: [escrow.ts:1085](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1085) + This function returns the balance for a specified escrow address. #### Parameters @@ -641,16 +625,14 @@ const escrowClient = await EscrowClient.build(provider); const balance = await escrowClient.getBalance('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1085](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1085) - *** ### getExchangeOracleAddress() > **getExchangeOracleAddress**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1471](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1471) + This function returns the exchange oracle address for a given escrow. #### Parameters @@ -681,16 +663,14 @@ const escrowClient = await EscrowClient.build(provider); const oracleAddress = await escrowClient.getExchangeOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1471](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1471) - *** ### getFactoryAddress() > **getFactoryAddress**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1509](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1509) + This function returns the escrow factory address for a given escrow. #### Parameters @@ -721,16 +701,14 @@ const escrowClient = await EscrowClient.build(provider); const factoryAddress = await escrowClient.getFactoryAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1509](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1509) - *** ### getIntermediateResultsUrl() > **getIntermediateResultsUrl**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1243](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1243) + This function returns the intermediate results file URL. #### Parameters @@ -761,16 +739,14 @@ const escrowClient = await EscrowClient.build(provider); const intermediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1243](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1243) - *** ### getJobLauncherAddress() > **getJobLauncherAddress**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1395](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1395) + This function returns the job launcher address for a given escrow. #### Parameters @@ -801,16 +777,14 @@ const escrowClient = await EscrowClient.build(provider); const jobLauncherAddress = await escrowClient.getJobLauncherAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1395](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1395) - *** ### getManifestHash() > **getManifestHash**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1129](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1129) + This function returns the manifest file hash. #### Parameters @@ -841,16 +815,14 @@ const escrowClient = await EscrowClient.build(provider); const manifestHash = await escrowClient.getManifestHash('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1129](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1129) - *** ### getManifestUrl() > **getManifestUrl**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1167](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1167) + This function returns the manifest file URL. #### Parameters @@ -881,16 +853,14 @@ const escrowClient = await EscrowClient.build(provider); const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1167](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1167) - *** ### getRecordingOracleAddress() > **getRecordingOracleAddress**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1357](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1357) + This function returns the recording oracle address for a given escrow. #### Parameters @@ -921,16 +891,14 @@ const escrowClient = await EscrowClient.build(provider); const oracleAddress = await escrowClient.getRecordingOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1357](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1357) - *** ### getReputationOracleAddress() > **getReputationOracleAddress**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1433](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1433) + This function returns the reputation oracle address for a given escrow. #### Parameters @@ -961,16 +929,14 @@ const escrowClient = await EscrowClient.build(provider); const oracleAddress = await escrowClient.getReputationOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1433](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1433) - *** ### getResultsUrl() > **getResultsUrl**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1205](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1205) + This function returns the results file URL. #### Parameters @@ -1001,16 +967,14 @@ const escrowClient = await EscrowClient.build(provider); const resultsUrl = await escrowClient.getResultsUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1205](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1205) - *** ### getStatus() > **getStatus**(`escrowAddress`): `Promise`\<[`EscrowStatus`](../../types/enumerations/EscrowStatus.md)\> +Defined in: [escrow.ts:1319](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1319) + This function returns the current status of the escrow. #### Parameters @@ -1041,16 +1005,14 @@ const escrowClient = await EscrowClient.build(provider); const status = await escrowClient.getStatus('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1319](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1319) - *** ### getTokenAddress() > **getTokenAddress**(`escrowAddress`): `Promise`\<`string`\> +Defined in: [escrow.ts:1281](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1281) + This function returns the token address used for funding the escrow. #### Parameters @@ -1081,16 +1043,14 @@ const escrowClient = await EscrowClient.build(provider); const tokenAddress = await escrowClient.getTokenAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[escrow.ts:1281](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1281) - *** ### setup() > **setup**(`escrowAddress`, `escrowConfig`, `txOptions`?): `Promise`\<`void`\> +Defined in: [escrow.ts:304](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L304) + This function sets up the parameters of the escrow. #### Parameters @@ -1148,16 +1108,14 @@ const escrowConfig = { await escrowClient.setup(escrowAddress, escrowConfig); ``` -#### Defined in - -[escrow.ts:304](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L304) - *** ### storeResults() > **storeResults**(`escrowAddress`, `url`, `hash`, `txOptions`?): `Promise`\<`void`\> +Defined in: [escrow.ts:479](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L479) + This function stores the results URL and hash. #### Parameters @@ -1210,16 +1168,14 @@ const escrowClient = await EscrowClient.build(signer); await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'); ``` -#### Defined in - -[escrow.ts:479](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L479) - *** ### withdraw() > **withdraw**(`escrowAddress`, `tokenAddress`, `txOptions`?): `Promise`\<[`EscrowWithdraw`](../../types/type-aliases/EscrowWithdraw.md)\> +Defined in: [escrow.ts:837](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L837) + This function withdraws additional tokens in the escrow to the canceler. #### Parameters @@ -1269,16 +1225,14 @@ await escrowClient.withdraw( ); ``` -#### Defined in - -[escrow.ts:837](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L837) - *** ### build() > `static` **build**(`runner`): `Promise`\<[`EscrowClient`](EscrowClient.md)\> +Defined in: [escrow.ts:161](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L161) + Creates an instance of EscrowClient from a Runner. #### Parameters @@ -1302,7 +1256,3 @@ Thrown if the provider does not exist for the provided Signer #### Throws Thrown if the network's chainId is not supported - -#### Defined in - -[escrow.ts:161](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L161) diff --git a/docs/sdk/typescript/escrow/classes/EscrowUtils.md b/docs/sdk/typescript/escrow/classes/EscrowUtils.md index 3893d00b9e..3c559646be 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowUtils.md +++ b/docs/sdk/typescript/escrow/classes/EscrowUtils.md @@ -6,6 +6,8 @@ # Class: EscrowUtils +Defined in: [escrow.ts:1558](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1558) + ## Introduction Utility class for escrow-related operations. @@ -52,6 +54,8 @@ const escrowAddresses = new EscrowUtils.getEscrows({ > `static` **getEscrow**(`chainId`, `escrowAddress`): `Promise`\<[`EscrowData`](../../graphql/types/type-aliases/EscrowData.md)\> +Defined in: [escrow.ts:1773](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1773) + This function returns the escrow data for a given address. > This uses Subgraph @@ -123,16 +127,14 @@ import { ChainId, EscrowUtils } from '@human-protocol/sdk'; const escrowData = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890123456789012345678901234567890"); ``` -#### Defined in - -[escrow.ts:1773](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1773) - *** ### getEscrows() > `static` **getEscrows**(`filter`): `Promise`\<[`EscrowData`](../../graphql/types/type-aliases/EscrowData.md)[]\> +Defined in: [escrow.ts:1655](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1655) + This function returns an array of escrows based on the specified filter parameters. **Input parameters** @@ -237,16 +239,14 @@ const filters: IEscrowsFilter = { const escrowDatas = await EscrowUtils.getEscrows(filters); ``` -#### Defined in - -[escrow.ts:1655](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1655) - *** ### getStatusEvents() > `static` **getStatusEvents**(`chainId`, `statuses`?, `from`?, `to`?, `launcher`?, `first`?, `skip`?, `orderDirection`?): `Promise`\<[`StatusEvent`](../../graphql/types/type-aliases/StatusEvent.md)[]\> +Defined in: [escrow.ts:1860](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1860) + This function returns the status events for a given set of networks within an optional date range. > This uses Subgraph @@ -354,7 +354,3 @@ import { ChainId, EscrowUtils, EscrowStatus } from '@human-protocol/sdk'; console.log(statusEvents); })(); ``` - -#### Defined in - -[escrow.ts:1860](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1860) diff --git a/docs/sdk/typescript/graphql/types/README.md b/docs/sdk/typescript/graphql/types/README.md index ae586ff40f..7b33bd7937 100644 --- a/docs/sdk/typescript/graphql/types/README.md +++ b/docs/sdk/typescript/graphql/types/README.md @@ -6,9 +6,7 @@ # graphql/types -## Index - -### Type Aliases +## Type Aliases - [DailyEscrowData](type-aliases/DailyEscrowData.md) - [DailyHMTData](type-aliases/DailyHMTData.md) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md index 03b3b60023..a710721fe7 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md @@ -8,6 +8,8 @@ > **DailyEscrowData**: `object` +Defined in: [graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) + ## Type declaration ### escrowsCancelled @@ -33,7 +35,3 @@ ### timestamp > **timestamp**: `Date` - -## Defined in - -[graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 e35fe81535..0007ba8dc0 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md @@ -8,6 +8,8 @@ > **DailyHMTData**: `object` +Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) + ## Type declaration ### dailyUniqueReceivers @@ -29,7 +31,3 @@ ### totalTransactionCount > **totalTransactionCount**: `number` - -## Defined in - -[graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 a4918ee4c9..25769b81cb 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md @@ -8,6 +8,8 @@ > **DailyPaymentData**: `object` +Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) + ## Type declaration ### averageAmountPerWorker @@ -25,7 +27,3 @@ ### totalCount > **totalCount**: `number` - -## Defined in - -[graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 8a28061766..c71d718fe8 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md @@ -8,6 +8,8 @@ > **DailyTaskData**: `object` +Defined in: [graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) + ## Type declaration ### tasksSolved @@ -21,7 +23,3 @@ ### timestamp > **timestamp**: `Date` - -## Defined in - -[graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 e2ec52c873..e39d40f6e4 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md @@ -8,6 +8,8 @@ > **DailyWorkerData**: `object` +Defined in: [graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) + ## Type declaration ### activeWorkers @@ -17,7 +19,3 @@ ### timestamp > **timestamp**: `Date` - -## Defined in - -[graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 43b65782b0..6af340f156 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md @@ -8,6 +8,8 @@ > **EscrowData**: `object` +Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) + ## Type declaration ### address @@ -85,7 +87,3 @@ ### totalFundedAmount > **totalFundedAmount**: `string` - -## Defined in - -[graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 577db99331..b7d33856ff 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md @@ -8,6 +8,8 @@ > **EscrowStatistics**: `object` +Defined in: [graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) + ## Type declaration ### dailyEscrowsData @@ -17,7 +19,3 @@ ### totalEscrows > **totalEscrows**: `number` - -## Defined in - -[graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 835c5e7d0f..c65ac8ca5a 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md @@ -8,6 +8,8 @@ > **EscrowStatisticsData**: `object` +Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) + ## Type declaration ### bulkPayoutEventCount @@ -49,7 +51,3 @@ ### totalEventCount > **totalEventCount**: `string` - -## Defined in - -[graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 a0e78761dd..6a888a4c4f 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md @@ -8,6 +8,8 @@ > **EventDayData**: `object` +Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) + ## Type declaration ### dailyBulkPayoutEventCount @@ -81,7 +83,3 @@ ### timestamp > **timestamp**: `string` - -## Defined in - -[graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 fbf56d94e5..7dbf85afbb 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md @@ -8,6 +8,8 @@ > **HMTHolder**: `object` +Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) + ## Type declaration ### address @@ -17,7 +19,3 @@ ### balance > **balance**: `bigint` - -## Defined in - -[graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 8f40153e52..fbc4efeef7 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md @@ -8,6 +8,8 @@ > **HMTHolderData**: `object` +Defined in: [graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) + ## Type declaration ### address @@ -17,7 +19,3 @@ ### balance > **balance**: `string` - -## Defined in - -[graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 e74b7ce592..cbaf3a162d 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md @@ -8,6 +8,8 @@ > **HMTStatistics**: `object` +Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) + ## Type declaration ### totalHolders @@ -21,7 +23,3 @@ ### totalTransferCount > **totalTransferCount**: `number` - -## Defined in - -[graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 9f8a624494..c4b4a2b58c 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md @@ -8,6 +8,8 @@ > **HMTStatisticsData**: `object` +Defined in: [graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) + ## Type declaration ### holders @@ -33,7 +35,3 @@ ### totalValueTransfered > **totalValueTransfered**: `string` - -## Defined in - -[graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 2821bb1fb8..a815345c60 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md @@ -8,6 +8,4 @@ > **IMData**: `Record`\<`string`, [`IMDataEntity`](IMDataEntity.md)\> -## Defined in - -[graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) +Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/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 2b79e36d91..e522d32d83 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md @@ -8,6 +8,8 @@ > **IMDataEntity**: `object` +Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) + ## Type declaration ### served @@ -17,7 +19,3 @@ ### solved > **solved**: `number` - -## Defined in - -[graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 e05007b07a..5f33fc202e 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md @@ -8,6 +8,8 @@ > **KVStoreData**: `object` +Defined in: [graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) + ## Type declaration ### address @@ -33,7 +35,3 @@ ### value > **value**: `string` - -## Defined in - -[graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 0f487ec610..2e3759c6f8 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md @@ -8,12 +8,10 @@ > **PaymentStatistics**: `object` +Defined in: [graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) + ## Type declaration ### dailyPaymentsData > **dailyPaymentsData**: [`DailyPaymentData`](DailyPaymentData.md)[] - -## Defined in - -[graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 776a20f9d1..bb0362bb47 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md @@ -8,6 +8,8 @@ > **PayoutData**: `object` +Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) + ## Type declaration ### amount @@ -29,7 +31,3 @@ ### recipient > **recipient**: `string` - -## Defined in - -[graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 4650dc235f..e6a086e104 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md @@ -8,6 +8,8 @@ > **RewardAddedEventData**: `object` +Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) + ## Type declaration ### amount @@ -25,7 +27,3 @@ ### staker > **staker**: `string` - -## Defined in - -[graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 b1f671dee5..6eac1851f1 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md @@ -8,6 +8,8 @@ > **StatusEvent**: `object` +Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) + ## Type declaration ### chainId @@ -25,7 +27,3 @@ ### timestamp > **timestamp**: `number` - -## Defined in - -[graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 b67df1577f..dcc05e52cf 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md @@ -8,12 +8,10 @@ > **TaskStatistics**: `object` +Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) + ## Type declaration ### dailyTasksData > **dailyTasksData**: [`DailyTaskData`](DailyTaskData.md)[] - -## Defined in - -[graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 3c3db6091b..60aa3c5894 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md @@ -8,12 +8,10 @@ > **WorkerStatistics**: `object` +Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) + ## Type declaration ### dailyWorkersData > **dailyWorkersData**: [`DailyWorkerData`](DailyWorkerData.md)[] - -## Defined in - -[graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 3774917e75..5f4b10c270 100644 --- a/docs/sdk/typescript/interfaces/README.md +++ b/docs/sdk/typescript/interfaces/README.md @@ -6,20 +6,16 @@ # interfaces -## Index - -### Interfaces +## Interfaces - [IEscrowConfig](interfaces/IEscrowConfig.md) - [IEscrowsFilter](interfaces/IEscrowsFilter.md) - [IHMTHoldersParams](interfaces/IHMTHoldersParams.md) - [IKeyPair](interfaces/IKeyPair.md) - [IKVStore](interfaces/IKVStore.md) -- [ILeader](interfaces/ILeader.md) -- [ILeadersFilter](interfaces/ILeadersFilter.md) -- [ILeaderSubgraph](interfaces/ILeaderSubgraph.md) - [InternalTransaction](interfaces/InternalTransaction.md) - [IOperator](interfaces/IOperator.md) +- [IOperatorsFilter](interfaces/IOperatorsFilter.md) - [IOperatorSubgraph](interfaces/IOperatorSubgraph.md) - [IPagination](interfaces/IPagination.md) - [IPayoutFilter](interfaces/IPayoutFilter.md) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md index bcc0f28edb..fa0a787f88 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md @@ -6,15 +6,15 @@ # Interface: IEscrowConfig +Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) + ## Properties ### exchangeOracle > **exchangeOracle**: `string` -#### Defined in - -[interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) +Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) *** @@ -22,9 +22,7 @@ > **exchangeOracleFee**: `bigint` -#### Defined in - -[interfaces.ts:89](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L89) +Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) *** @@ -32,9 +30,7 @@ > **manifestHash**: `string` -#### Defined in - -[interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) +Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) *** @@ -42,9 +38,7 @@ > **manifestUrl**: `string` -#### Defined in - -[interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) +Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) *** @@ -52,9 +46,7 @@ > **recordingOracle**: `string` -#### Defined in - -[interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) +Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) *** @@ -62,9 +54,7 @@ > **recordingOracleFee**: `bigint` -#### Defined in - -[interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) +Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) *** @@ -72,9 +62,7 @@ > **reputationOracle**: `string` -#### Defined in - -[interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) +Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) *** @@ -82,6 +70,4 @@ > **reputationOracleFee**: `bigint` -#### Defined in - -[interfaces.ts:88](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L88) +Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md index c3e2f92732..2d9db02620 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md @@ -6,6 +6,8 @@ # Interface: IEscrowsFilter +Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) + ## Extends - [`IPagination`](IPagination.md) @@ -16,9 +18,7 @@ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -#### Defined in - -[interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) +Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) *** @@ -26,9 +26,7 @@ > `optional` **exchangeOracle**: `string` -#### Defined in - -[interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) +Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) *** @@ -36,23 +34,19 @@ > `optional` **first**: `number` +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) + #### Inherited from [`IPagination`](IPagination.md).[`first`](IPagination.md#first) -#### Defined in - -[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) - *** ### from? > `optional` **from**: `Date` -#### Defined in - -[interfaces.ts:78](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L78) +Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) *** @@ -60,9 +54,7 @@ > `optional` **jobRequesterId**: `string` -#### Defined in - -[interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) +Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) *** @@ -70,9 +62,7 @@ > `optional` **launcher**: `string` -#### Defined in - -[interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) +Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) *** @@ -80,23 +70,19 @@ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) + #### Inherited from [`IPagination`](IPagination.md).[`orderDirection`](IPagination.md#orderdirection) -#### Defined in - -[interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) - *** ### recordingOracle? > `optional` **recordingOracle**: `string` -#### Defined in - -[interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) +Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) *** @@ -104,9 +90,7 @@ > `optional` **reputationOracle**: `string` -#### Defined in - -[interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) +Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) *** @@ -114,23 +98,19 @@ > `optional` **skip**: `number` +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) + #### Inherited from [`IPagination`](IPagination.md).[`skip`](IPagination.md#skip) -#### Defined in - -[interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) - *** ### status? > `optional` **status**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md) -#### Defined in - -[interfaces.ts:77](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L77) +Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) *** @@ -138,6 +118,4 @@ > `optional` **to**: `Date` -#### Defined in - -[interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) +Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) diff --git a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md index 87ac94c4da..efa88e282b 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md +++ b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md @@ -6,6 +6,8 @@ # Interface: IHMTHoldersParams +Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) + ## Extends - [`IPagination`](IPagination.md) @@ -16,9 +18,7 @@ > `optional` **address**: `string` -#### Defined in - -[interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) +Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) *** @@ -26,38 +26,32 @@ > `optional` **first**: `number` +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) + #### Inherited from [`IPagination`](IPagination.md).[`first`](IPagination.md#first) -#### Defined in - -[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) - *** ### orderDirection? > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) + #### Inherited from [`IPagination`](IPagination.md).[`orderDirection`](IPagination.md#orderdirection) -#### Defined in - -[interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) - *** ### skip? > `optional` **skip**: `number` +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) + #### Inherited from [`IPagination`](IPagination.md).[`skip`](IPagination.md#skip) - -#### Defined in - -[interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) diff --git a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md index d3db4b5d0a..24c492d012 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md @@ -6,15 +6,15 @@ # Interface: IKVStore +Defined in: [interfaces.ts:113](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L113) + ## Properties ### key > **key**: `string` -#### Defined in - -[interfaces.ts:118](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L118) +Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) *** @@ -22,6 +22,4 @@ > **value**: `string` -#### Defined in - -[interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) +Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) diff --git a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md index 3c6aade6bb..175caaaa7d 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md @@ -6,15 +6,15 @@ # Interface: IKeyPair +Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) + ## Properties ### passphrase > **passphrase**: `string` -#### Defined in - -[interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) +Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) *** @@ -22,9 +22,7 @@ > **privateKey**: `string` -#### Defined in - -[interfaces.ts:95](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L95) +Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) *** @@ -32,9 +30,7 @@ > **publicKey**: `string` -#### Defined in - -[interfaces.ts:96](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L96) +Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) *** @@ -42,6 +38,4 @@ > `optional` **revocationCertificate**: `string` -#### Defined in - -[interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) +Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) diff --git a/docs/sdk/typescript/interfaces/interfaces/ILeader.md b/docs/sdk/typescript/interfaces/interfaces/ILeader.md deleted file mode 100644 index a83e5c8d3a..0000000000 --- a/docs/sdk/typescript/interfaces/interfaces/ILeader.md +++ /dev/null @@ -1,227 +0,0 @@ -[**@human-protocol/sdk**](../../README.md) - -*** - -[@human-protocol/sdk](../../modules.md) / [interfaces](../README.md) / ILeader - -# Interface: ILeader - -## Properties - -### address - -> **address**: `string` - -#### Defined in - -[interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) - -*** - -### amountJobsProcessed - -> **amountJobsProcessed**: `bigint` - -#### Defined in - -[interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) - -*** - -### amountLocked - -> **amountLocked**: `bigint` - -#### Defined in - -[interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) - -*** - -### amountSlashed - -> **amountSlashed**: `bigint` - -#### Defined in - -[interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) - -*** - -### amountStaked - -> **amountStaked**: `bigint` - -#### Defined in - -[interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) - -*** - -### amountWithdrawn - -> **amountWithdrawn**: `bigint` - -#### Defined in - -[interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) - -*** - -### category? - -> `optional` **category**: `string` - -#### Defined in - -[interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) - -*** - -### chainId - -> **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) - -#### Defined in - -[interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) - -*** - -### fee? - -> `optional` **fee**: `bigint` - -#### Defined in - -[interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) - -*** - -### id - -> **id**: `string` - -#### Defined in - -[interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) - -*** - -### jobTypes? - -> `optional` **jobTypes**: `string`[] - -#### Defined in - -[interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) - -*** - -### lockedUntilTimestamp - -> **lockedUntilTimestamp**: `bigint` - -#### Defined in - -[interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) - -*** - -### name? - -> `optional` **name**: `string` - -#### Defined in - -[interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) - -*** - -### publicKey? - -> `optional` **publicKey**: `string` - -#### Defined in - -[interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) - -*** - -### registrationInstructions? - -> `optional` **registrationInstructions**: `string` - -#### Defined in - -[interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) - -*** - -### registrationNeeded? - -> `optional` **registrationNeeded**: `boolean` - -#### Defined in - -[interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) - -*** - -### reputationNetworks? - -> `optional` **reputationNetworks**: `string`[] - -#### Defined in - -[interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) - -*** - -### reward - -> **reward**: `bigint` - -#### Defined in - -[interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) - -*** - -### role? - -> `optional` **role**: `string` - -#### Defined in - -[interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) - -*** - -### url? - -> `optional` **url**: `string` - -#### Defined in - -[interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) - -*** - -### webhookUrl? - -> `optional` **webhookUrl**: `string` - -#### Defined in - -[interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) - -*** - -### website? - -> `optional` **website**: `string` - -#### Defined in - -[interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 deleted file mode 100644 index 612304ecfc..0000000000 --- a/docs/sdk/typescript/interfaces/interfaces/ILeaderSubgraph.md +++ /dev/null @@ -1,297 +0,0 @@ -[**@human-protocol/sdk**](../../README.md) - -*** - -[@human-protocol/sdk](../../modules.md) / [interfaces](../README.md) / ILeaderSubgraph - -# Interface: ILeaderSubgraph - -## Extends - -- `Omit`\<[`ILeader`](ILeader.md), `"jobTypes"` \| `"reputationNetworks"` \| `"chainId"`\> - -## Properties - -### address - -> **address**: `string` - -#### Inherited from - -`Omit.address` - -#### Defined in - -[interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) - -*** - -### amountJobsProcessed - -> **amountJobsProcessed**: `bigint` - -#### Inherited from - -`Omit.amountJobsProcessed` - -#### Defined in - -[interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) - -*** - -### amountLocked - -> **amountLocked**: `bigint` - -#### Inherited from - -`Omit.amountLocked` - -#### Defined in - -[interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) - -*** - -### amountSlashed - -> **amountSlashed**: `bigint` - -#### Inherited from - -`Omit.amountSlashed` - -#### Defined in - -[interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) - -*** - -### amountStaked - -> **amountStaked**: `bigint` - -#### Inherited from - -`Omit.amountStaked` - -#### Defined in - -[interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) - -*** - -### amountWithdrawn - -> **amountWithdrawn**: `bigint` - -#### Inherited from - -`Omit.amountWithdrawn` - -#### Defined in - -[interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) - -*** - -### category? - -> `optional` **category**: `string` - -#### Inherited from - -`Omit.category` - -#### Defined in - -[interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) - -*** - -### fee? - -> `optional` **fee**: `bigint` - -#### Inherited from - -`Omit.fee` - -#### Defined in - -[interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) - -*** - -### id - -> **id**: `string` - -#### Inherited from - -`Omit.id` - -#### Defined in - -[interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) - -*** - -### jobTypes? - -> `optional` **jobTypes**: `string` - -#### Defined in - -[interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) - -*** - -### lockedUntilTimestamp - -> **lockedUntilTimestamp**: `bigint` - -#### Inherited from - -`Omit.lockedUntilTimestamp` - -#### Defined in - -[interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) - -*** - -### name? - -> `optional` **name**: `string` - -#### Inherited from - -`Omit.name` - -#### Defined in - -[interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) - -*** - -### publicKey? - -> `optional` **publicKey**: `string` - -#### Inherited from - -`Omit.publicKey` - -#### Defined in - -[interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) - -*** - -### registrationInstructions? - -> `optional` **registrationInstructions**: `string` - -#### Inherited from - -`Omit.registrationInstructions` - -#### Defined in - -[interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) - -*** - -### registrationNeeded? - -> `optional` **registrationNeeded**: `boolean` - -#### Inherited from - -`Omit.registrationNeeded` - -#### Defined in - -[interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) - -*** - -### reputationNetworks? - -> `optional` **reputationNetworks**: `object`[] - -#### Defined in - -[interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) - -*** - -### reward - -> **reward**: `bigint` - -#### Inherited from - -`Omit.reward` - -#### Defined in - -[interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) - -*** - -### role? - -> `optional` **role**: `string` - -#### Inherited from - -`Omit.role` - -#### Defined in - -[interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) - -*** - -### url? - -> `optional` **url**: `string` - -#### Inherited from - -`Omit.url` - -#### Defined in - -[interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) - -*** - -### webhookUrl? - -> `optional` **webhookUrl**: `string` - -#### Inherited from - -`Omit.webhookUrl` - -#### Defined in - -[interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) - -*** - -### website? - -> `optional` **website**: `string` - -#### Inherited from - -`Omit.website` - -#### Defined in - -[interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 deleted file mode 100644 index 11a96b4695..0000000000 --- a/docs/sdk/typescript/interfaces/interfaces/ILeadersFilter.md +++ /dev/null @@ -1,93 +0,0 @@ -[**@human-protocol/sdk**](../../README.md) - -*** - -[@human-protocol/sdk](../../modules.md) / [interfaces](../README.md) / ILeadersFilter - -# Interface: ILeadersFilter - -## Extends - -- [`IPagination`](IPagination.md) - -## Properties - -### chainId - -> **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) - -#### Defined in - -[interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) - -*** - -### first? - -> `optional` **first**: `number` - -#### Inherited from - -[`IPagination`](IPagination.md).[`first`](IPagination.md#first) - -#### Defined in - -[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) - -*** - -### minAmountStaked? - -> `optional` **minAmountStaked**: `number` - -#### Defined in - -[interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) - -*** - -### orderBy? - -> `optional` **orderBy**: `string` - -#### Defined in - -[interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) - -*** - -### orderDirection? - -> `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) - -#### Inherited from - -[`IPagination`](IPagination.md).[`orderDirection`](IPagination.md#orderdirection) - -#### Defined in - -[interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) - -*** - -### roles? - -> `optional` **roles**: `string`[] - -#### Defined in - -[interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) - -*** - -### skip? - -> `optional` **skip**: `number` - -#### Inherited from - -[`IPagination`](IPagination.md).[`skip`](IPagination.md#skip) - -#### Defined in - -[interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperator.md b/docs/sdk/typescript/interfaces/interfaces/IOperator.md index ef585bcb1f..19de7da259 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperator.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperator.md @@ -6,15 +6,87 @@ # Interface: IOperator +Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) + ## Properties ### address > **address**: `string` -#### Defined in +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) + +*** + +### amountJobsProcessed + +> **amountJobsProcessed**: `bigint` + +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) + +*** + +### amountLocked + +> **amountLocked**: `bigint` + +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) + +*** + +### amountSlashed + +> **amountSlashed**: `bigint` + +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) + +*** + +### amountStaked + +> **amountStaked**: `bigint` + +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) + +*** + +### amountWithdrawn + +> **amountWithdrawn**: `bigint` + +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) + +*** + +### category? + +> `optional` **category**: `string` + +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) + +*** + +### chainId + +> **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) + +Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) + +*** + +### fee? + +> `optional` **fee**: `bigint` -[interfaces.ts:59](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L59) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) + +*** + +### id + +> **id**: `string` + +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) *** @@ -22,9 +94,31 @@ > `optional` **jobTypes**: `string`[] -#### Defined in +Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) + +*** + +### lockedUntilTimestamp + +> **lockedUntilTimestamp**: `bigint` + +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) -[interfaces.ts:62](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L62) +*** + +### name? + +> `optional` **name**: `string` + +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) + +*** + +### publicKey? + +> `optional` **publicKey**: `string` + +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) *** @@ -32,9 +126,7 @@ > `optional` **registrationInstructions**: `string` -#### Defined in - -[interfaces.ts:64](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L64) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) *** @@ -42,9 +134,23 @@ > `optional` **registrationNeeded**: `boolean` -#### Defined in +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) -[interfaces.ts:63](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L63) +*** + +### reputationNetworks? + +> `optional` **reputationNetworks**: `string`[] + +Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) + +*** + +### reward + +> **reward**: `bigint` + +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) *** @@ -52,9 +158,7 @@ > `optional` **role**: `string` -#### Defined in - -[interfaces.ts:60](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L60) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) *** @@ -62,6 +166,20 @@ > `optional` **url**: `string` -#### Defined in +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) + +*** + +### webhookUrl? + +> `optional` **webhookUrl**: `string` + +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) + +*** + +### website? + +> `optional` **website**: `string` -[interfaces.ts:61](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L61) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md index 33e2c9d4e7..67010ab6c1 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md @@ -6,9 +6,11 @@ # Interface: IOperatorSubgraph +Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) + ## Extends -- `Omit`\<[`IOperator`](IOperator.md), `"jobTypes"`\> +- `Omit`\<[`IOperator`](IOperator.md), `"jobTypes"` \| `"reputationNetworks"` \| `"chainId"`\> ## Properties @@ -16,13 +18,107 @@ > **address**: `string` +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) + #### Inherited from `Omit.address` -#### Defined in +*** + +### amountJobsProcessed + +> **amountJobsProcessed**: `bigint` + +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) + +#### Inherited from + +`Omit.amountJobsProcessed` + +*** + +### amountLocked + +> **amountLocked**: `bigint` + +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) + +#### Inherited from + +`Omit.amountLocked` + +*** + +### amountSlashed + +> **amountSlashed**: `bigint` + +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) + +#### Inherited from + +`Omit.amountSlashed` + +*** + +### amountStaked + +> **amountStaked**: `bigint` + +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) + +#### Inherited from + +`Omit.amountStaked` + +*** + +### amountWithdrawn + +> **amountWithdrawn**: `bigint` + +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) + +#### Inherited from -[interfaces.ts:59](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L59) +`Omit.amountWithdrawn` + +*** + +### category? + +> `optional` **category**: `string` + +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) + +#### Inherited from + +`Omit.category` + +*** + +### fee? + +> `optional` **fee**: `bigint` + +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) + +#### Inherited from + +`Omit.fee` + +*** + +### id + +> **id**: `string` + +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) + +#### Inherited from + +`Omit.id` *** @@ -30,9 +126,43 @@ > `optional` **jobTypes**: `string` -#### Defined in +Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) + +*** + +### lockedUntilTimestamp + +> **lockedUntilTimestamp**: `bigint` + +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) + +#### Inherited from -[interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) +`Omit.lockedUntilTimestamp` + +*** + +### name? + +> `optional` **name**: `string` + +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) + +#### Inherited from + +`Omit.name` + +*** + +### publicKey? + +> `optional` **publicKey**: `string` + +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) + +#### Inherited from + +`Omit.publicKey` *** @@ -40,27 +170,47 @@ > `optional` **registrationInstructions**: `string` +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) + #### Inherited from `Omit.registrationInstructions` -#### Defined in - -[interfaces.ts:64](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L64) - *** ### registrationNeeded? > `optional` **registrationNeeded**: `boolean` +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) + #### Inherited from `Omit.registrationNeeded` -#### Defined in +*** + +### reputationNetworks? -[interfaces.ts:63](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L63) +> `optional` **reputationNetworks**: `object`[] + +Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) + +#### address + +> **address**: `string` + +*** + +### reward + +> **reward**: `bigint` + +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) + +#### Inherited from + +`Omit.reward` *** @@ -68,24 +218,44 @@ > `optional` **role**: `string` +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) + #### Inherited from `Omit.role` -#### Defined in - -[interfaces.ts:60](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L60) - *** ### url? > `optional` **url**: `string` +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) + #### Inherited from `Omit.url` -#### Defined in +*** + +### webhookUrl? + +> `optional` **webhookUrl**: `string` + +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) + +#### Inherited from + +`Omit.webhookUrl` + +*** + +### website? + +> `optional` **website**: `string` + +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) + +#### Inherited from -[interfaces.ts:61](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L61) +`Omit.website` diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md new file mode 100644 index 0000000000..db1065a56d --- /dev/null +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md @@ -0,0 +1,81 @@ +[**@human-protocol/sdk**](../../README.md) + +*** + +[@human-protocol/sdk](../../modules.md) / [interfaces](../README.md) / IOperatorsFilter + +# Interface: IOperatorsFilter + +Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) + +## Extends + +- [`IPagination`](IPagination.md) + +## Properties + +### chainId + +> **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) + +Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) + +*** + +### first? + +> `optional` **first**: `number` + +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) + +#### Inherited from + +[`IPagination`](IPagination.md).[`first`](IPagination.md#first) + +*** + +### minAmountStaked? + +> `optional` **minAmountStaked**: `number` + +Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) + +*** + +### orderBy? + +> `optional` **orderBy**: `string` + +Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) + +*** + +### orderDirection? + +> `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) + +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) + +#### Inherited from + +[`IPagination`](IPagination.md).[`orderDirection`](IPagination.md#orderdirection) + +*** + +### roles? + +> `optional` **roles**: `string`[] + +Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) + +*** + +### skip? + +> `optional` **skip**: `number` + +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) + +#### Inherited from + +[`IPagination`](IPagination.md).[`skip`](IPagination.md#skip) diff --git a/docs/sdk/typescript/interfaces/interfaces/IPagination.md b/docs/sdk/typescript/interfaces/interfaces/IPagination.md index 55ce72b6f2..61fc8370bd 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPagination.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPagination.md @@ -6,9 +6,11 @@ # Interface: IPagination +Defined in: [interfaces.ts:152](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L152) + ## Extended by -- [`ILeadersFilter`](ILeadersFilter.md) +- [`IOperatorsFilter`](IOperatorsFilter.md) - [`IEscrowsFilter`](IEscrowsFilter.md) - [`IStatisticsFilter`](IStatisticsFilter.md) - [`IHMTHoldersParams`](IHMTHoldersParams.md) @@ -20,9 +22,7 @@ > `optional` **first**: `number` -#### Defined in - -[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) *** @@ -30,9 +30,7 @@ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -#### Defined in - -[interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) *** @@ -40,6 +38,4 @@ > `optional` **skip**: `number` -#### Defined in - -[interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) diff --git a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md index 51d87cff71..12595076ad 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md @@ -6,15 +6,15 @@ # Interface: IPayoutFilter +Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) + ## Properties ### escrowAddress? > `optional` **escrowAddress**: `string` -#### Defined in - -[interfaces.ts:111](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L111) +Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) *** @@ -22,9 +22,7 @@ > `optional` **from**: `Date` -#### Defined in - -[interfaces.ts:113](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L113) +Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) *** @@ -32,9 +30,7 @@ > `optional` **recipient**: `string` -#### Defined in - -[interfaces.ts:112](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L112) +Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) *** @@ -42,6 +38,4 @@ > `optional` **to**: `Date` -#### Defined in - -[interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) +Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md index 47ecf4acf2..09c53c2a0c 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md @@ -6,15 +6,15 @@ # Interface: IReputationNetwork +Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) + ## Properties ### address > **address**: `string` -#### Defined in - -[interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) *** @@ -22,9 +22,7 @@ > **id**: `string` -#### Defined in - -[interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) *** @@ -32,6 +30,4 @@ > **operators**: [`IOperator`](IOperator.md)[] -#### Defined in - -[interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) +Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md index b25744c18b..755b35d79e 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md @@ -6,6 +6,8 @@ # Interface: IReputationNetworkSubgraph +Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) + ## Extends - `Omit`\<[`IReputationNetwork`](IReputationNetwork.md), `"operators"`\> @@ -16,34 +18,28 @@ > **address**: `string` +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) + #### Inherited from `Omit.address` -#### Defined in - -[interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) - *** ### id > **id**: `string` +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) + #### Inherited from `Omit.id` -#### Defined in - -[interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) - *** ### operators > **operators**: [`IOperatorSubgraph`](IOperatorSubgraph.md)[] -#### Defined in - -[interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) +Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReward.md b/docs/sdk/typescript/interfaces/interfaces/IReward.md index aeb5c6a527..a8cb309f5c 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReward.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReward.md @@ -6,15 +6,15 @@ # Interface: IReward +Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) + ## Properties ### amount > **amount**: `bigint` -#### Defined in - -[interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) +Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) *** @@ -22,6 +22,4 @@ > **escrowAddress**: `string` -#### Defined in - -[interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) +Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/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 a462d7580e..189b653af1 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md @@ -6,6 +6,8 @@ # Interface: IStatisticsFilter +Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) + ## Extends - [`IPagination`](IPagination.md) @@ -16,23 +18,19 @@ > `optional` **first**: `number` +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) + #### Inherited from [`IPagination`](IPagination.md).[`first`](IPagination.md#first) -#### Defined in - -[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) - *** ### from? > `optional` **from**: `Date` -#### Defined in - -[interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) +Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) *** @@ -40,34 +38,28 @@ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) + #### Inherited from [`IPagination`](IPagination.md).[`orderDirection`](IPagination.md#orderdirection) -#### Defined in - -[interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) - *** ### skip? > `optional` **skip**: `number` +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) + #### Inherited from [`IPagination`](IPagination.md).[`skip`](IPagination.md#skip) -#### Defined in - -[interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) - *** ### to? > `optional` **to**: `Date` -#### Defined in - -[interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) +Defined in: [interfaces.ts:99](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L99) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md index 3056caaf81..b955575a89 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md @@ -6,15 +6,15 @@ # Interface: ITransaction +Defined in: [interfaces.ts:128](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L128) + ## Properties ### block > **block**: `bigint` -#### Defined in - -[interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) +Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) *** @@ -22,9 +22,7 @@ > `optional` **escrow**: `string` -#### Defined in - -[interfaces.ts:141](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L141) +Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) *** @@ -32,9 +30,7 @@ > **from**: `string` -#### Defined in - -[interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) +Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) *** @@ -42,9 +38,7 @@ > **internalTransactions**: [`InternalTransaction`](InternalTransaction.md)[] -#### Defined in - -[interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) +Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) *** @@ -52,9 +46,7 @@ > **method**: `string` -#### Defined in - -[interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) +Defined in: [interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) *** @@ -62,9 +54,7 @@ > `optional` **receiver**: `string` -#### Defined in - -[interfaces.ts:140](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L140) +Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) *** @@ -72,9 +62,7 @@ > **timestamp**: `bigint` -#### Defined in - -[interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) +Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) *** @@ -82,9 +70,7 @@ > **to**: `string` -#### Defined in - -[interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) +Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) *** @@ -92,9 +78,7 @@ > `optional` **token**: `string` -#### Defined in - -[interfaces.ts:142](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L142) +Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) *** @@ -102,9 +86,7 @@ > **txHash**: `string` -#### Defined in - -[interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) +Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) *** @@ -112,6 +94,4 @@ > **value**: `string` -#### Defined in - -[interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) +Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md index 97202e6e13..bf5baaaef9 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md @@ -6,6 +6,8 @@ # Interface: ITransactionsFilter +Defined in: [interfaces.ts:142](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L142) + ## Extends - [`IPagination`](IPagination.md) @@ -16,9 +18,7 @@ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -#### Defined in - -[interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) +Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) *** @@ -26,9 +26,7 @@ > `optional` **endBlock**: `number` -#### Defined in - -[interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) +Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) *** @@ -36,9 +34,7 @@ > `optional` **endDate**: `Date` -#### Defined in - -[interfaces.ts:151](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L151) +Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) *** @@ -46,23 +42,19 @@ > `optional` **first**: `number` +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) + #### Inherited from [`IPagination`](IPagination.md).[`first`](IPagination.md#first) -#### Defined in - -[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) - *** ### fromAddress? > `optional` **fromAddress**: `string` -#### Defined in - -[interfaces.ts:152](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L152) +Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) *** @@ -70,37 +62,31 @@ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) + #### Inherited from [`IPagination`](IPagination.md).[`orderDirection`](IPagination.md#orderdirection) -#### Defined in - -[interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) - *** ### skip? > `optional` **skip**: `number` +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) + #### Inherited from [`IPagination`](IPagination.md).[`skip`](IPagination.md#skip) -#### Defined in - -[interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) - *** ### startBlock? > `optional` **startBlock**: `number` -#### Defined in - -[interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) +Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) *** @@ -108,9 +94,7 @@ > `optional` **startDate**: `Date` -#### Defined in - -[interfaces.ts:150](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L150) +Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) *** @@ -118,6 +102,4 @@ > `optional` **toAddress**: `string` -#### Defined in - -[interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) diff --git a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md index da7814846f..7a1993cdb0 100644 --- a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md @@ -6,15 +6,15 @@ # Interface: InternalTransaction +Defined in: [interfaces.ts:118](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L118) + ## Properties ### escrow? > `optional` **escrow**: `string` -#### Defined in - -[interfaces.ts:128](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L128) +Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) *** @@ -22,9 +22,7 @@ > **from**: `string` -#### Defined in - -[interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) +Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) *** @@ -32,9 +30,7 @@ > **method**: `string` -#### Defined in - -[interfaces.ts:126](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L126) +Defined in: [interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) *** @@ -42,9 +38,7 @@ > `optional` **receiver**: `string` -#### Defined in - -[interfaces.ts:127](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L127) +Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) *** @@ -52,9 +46,7 @@ > **to**: `string` -#### Defined in - -[interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) +Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) *** @@ -62,9 +54,7 @@ > `optional` **token**: `string` -#### Defined in - -[interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) +Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) *** @@ -72,6 +62,4 @@ > **value**: `string` -#### Defined in - -[interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) +Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) diff --git a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md index ec38c0ce6b..6a07d5191d 100644 --- a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md +++ b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md @@ -6,15 +6,15 @@ # Interface: StakerInfo +Defined in: [interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) + ## Properties ### lockedAmount > **lockedAmount**: `bigint` -#### Defined in - -[interfaces.ts:164](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L164) +Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) *** @@ -22,9 +22,7 @@ > **lockedUntil**: `bigint` -#### Defined in - -[interfaces.ts:165](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L165) +Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) *** @@ -32,9 +30,7 @@ > **stakedAmount**: `bigint` -#### Defined in - -[interfaces.ts:163](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L163) +Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) *** @@ -42,6 +38,4 @@ > **withdrawableAmount**: `bigint` -#### Defined in - -[interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) +Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) diff --git a/docs/sdk/typescript/kvstore/README.md b/docs/sdk/typescript/kvstore/README.md index 7e025ffc9c..e2a5d8f801 100644 --- a/docs/sdk/typescript/kvstore/README.md +++ b/docs/sdk/typescript/kvstore/README.md @@ -6,9 +6,7 @@ # kvstore -## Index - -### Classes +## Classes - [KVStoreClient](classes/KVStoreClient.md) - [KVStoreUtils](classes/KVStoreUtils.md) diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md index 6d522d8429..d78e6862be 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md @@ -6,6 +6,8 @@ # Class: KVStoreClient +Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) + ## Introduction This client enables performing actions on KVStore contract and obtaining information from both the contracts and subgraph. @@ -84,6 +86,8 @@ const kvstoreClient = await KVStoreClient.build(provider); > **new KVStoreClient**(`runner`, `networkData`): [`KVStoreClient`](KVStoreClient.md) +Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) + **KVStoreClient constructor** #### Parameters @@ -108,23 +112,17 @@ The network information required to connect to the KVStore contract [`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) -#### Defined in - -[kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) - ## Properties ### networkData > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -#### Inherited from - -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) -#### Defined in +#### Inherited from -[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) *** @@ -132,13 +130,11 @@ The network information required to connect to the KVStore contract > `protected` **runner**: `ContractRunner` -#### Inherited from - -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) -#### Defined in +#### Inherited from -[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) ## Methods @@ -146,6 +142,8 @@ The network information required to connect to the KVStore contract > **set**(`key`, `value`, `txOptions`?): `Promise`\<`void`\> +Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) + This function sets a key-value pair associated with the address that submits the transaction. #### Parameters @@ -192,16 +190,14 @@ const kvstoreClient = await KVStoreClient.build(signer); await kvstoreClient.set('Role', 'RecordingOracle'); ``` -#### Defined in - -[kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) - *** ### setBulk() > **setBulk**(`keys`, `values`, `txOptions`?): `Promise`\<`void`\> +Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) + This function sets key-value pairs in bulk associated with the address that submits the transaction. #### Parameters @@ -250,16 +246,14 @@ const values = ['RecordingOracle', 'http://localhost']; await kvstoreClient.setBulk(keys, values); ``` -#### Defined in - -[kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) - *** ### setFileUrlAndHash() > **setFileUrlAndHash**(`url`, `urlKey`, `txOptions`?): `Promise`\<`void`\> +Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) + Sets a URL value for the address that submits the transaction, and its hash. #### Parameters @@ -305,16 +299,14 @@ await kvstoreClient.setFileUrlAndHash('example.com'); await kvstoreClient.setFileUrlAndHash('linkedin.com/example', 'linkedin_url'); ``` -#### Defined in - -[kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) - *** ### build() > `static` **build**(`runner`): `Promise`\<[`KVStoreClient`](KVStoreClient.md)\> +Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) + Creates an instance of KVStoreClient from a runner. #### Parameters @@ -338,7 +330,3 @@ The Runner object to interact with the Ethereum network #### Throws - Thrown if the network's chainId is not supported - -#### Defined in - -[kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 76d682b060..25c6968e0a 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md @@ -6,6 +6,8 @@ # Class: KVStoreUtils +Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) + ## Introduction Utility class for KVStore-related operations. @@ -53,6 +55,8 @@ const KVStoreAddresses = await KVStoreUtils.getKVStoreData( > `static` **get**(`chainId`, `address`, `key`): `Promise`\<`string`\> +Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) + Gets the value of a key-value pair in the KVStore using the subgraph. #### Parameters @@ -106,16 +110,14 @@ const value = await KVStoreUtils.get(chainId, address, key); console.log(value); ``` -#### Defined in - -[kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) - *** ### getFileUrlAndVerifyHash() > `static` **getFileUrlAndVerifyHash**(`chainId`, `address`, `urlKey`): `Promise`\<`string`\> +Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) + Gets the URL value of the given entity, and verifies its hash. #### Parameters @@ -156,16 +158,14 @@ const url = await KVStoreUtils.getFileUrlAndVerifyHash(chainId, address); console.log(url); ``` -#### Defined in - -[kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) - *** ### getKVStoreData() > `static` **getKVStoreData**(`chainId`, `address`): `Promise`\<[`IKVStore`](../../interfaces/interfaces/IKVStore.md)[]\> +Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) + This function returns the KVStore data for a given address. #### Parameters @@ -205,16 +205,14 @@ const kvStoreData = await KVStoreUtils.getKVStoreData(ChainId.POLYGON_AMOY, "0x1 console.log(kvStoreData); ``` -#### Defined in - -[kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) - *** ### getPublicKey() > `static` **getPublicKey**(`chainId`, `address`): `Promise`\<`string`\> +Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) + Gets the public key of the given entity, and verifies its hash. #### Parameters @@ -248,7 +246,3 @@ const address = '0x1234567890123456789012345678901234567890'; const publicKey = await KVStoreUtils.getPublicKey(chainId, address); console.log(publicKey); ``` - -#### Defined in - -[kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) diff --git a/docs/sdk/typescript/operator/README.md b/docs/sdk/typescript/operator/README.md index 0f9c5319f1..111fa065f0 100644 --- a/docs/sdk/typescript/operator/README.md +++ b/docs/sdk/typescript/operator/README.md @@ -6,8 +6,6 @@ # operator -## Index - -### Classes +## Classes - [OperatorUtils](classes/OperatorUtils.md) diff --git a/docs/sdk/typescript/operator/classes/OperatorUtils.md b/docs/sdk/typescript/operator/classes/OperatorUtils.md index b35ff5016c..64e02a0563 100644 --- a/docs/sdk/typescript/operator/classes/OperatorUtils.md +++ b/docs/sdk/typescript/operator/classes/OperatorUtils.md @@ -6,6 +6,8 @@ # Class: OperatorUtils +Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) + ## Constructors ### new OperatorUtils() @@ -18,11 +20,13 @@ ## Methods -### getLeader() +### getOperator() + +> `static` **getOperator**(`chainId`, `address`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)\> -> `static` **getLeader**(`chainId`, `address`): `Promise`\<[`ILeader`](../../interfaces/interfaces/ILeader.md)\> +Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) -This function returns the leader data for the given address. +This function returns the operator data for the given address. #### Parameters @@ -30,75 +34,71 @@ This function returns the leader data for the given address. [`ChainId`](../../enums/enumerations/ChainId.md) -Network in which the leader is deployed +Network in which the operator is deployed ##### address `string` -Leader address. +Operator address. #### Returns -`Promise`\<[`ILeader`](../../interfaces/interfaces/ILeader.md)\> +`Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)\> -Returns the leader details. +Returns the operator details. **Code example** ```ts import { OperatorUtils, ChainId } from '@human-protocol/sdk'; -const leader = await OperatorUtils.getLeader(ChainId.POLYGON_AMOY, '0x62dD51230A30401C455c8398d06F85e4EaB6309f'); +const operator = await OperatorUtils.getOperator(ChainId.POLYGON_AMOY, '0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[operator.ts:44](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L44) - *** -### getLeaders() +### getOperators() -> `static` **getLeaders**(`filter`): `Promise`\<[`ILeader`](../../interfaces/interfaces/ILeader.md)[]\> +> `static` **getOperators**(`filter`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -This function returns all the leader details of the protocol. +Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) + +This function returns all the operator details of the protocol. #### Parameters ##### filter -[`ILeadersFilter`](../../interfaces/interfaces/ILeadersFilter.md) +[`IOperatorsFilter`](../../interfaces/interfaces/IOperatorsFilter.md) -Filter for the leaders. +Filter for the operators. #### Returns -`Promise`\<[`ILeader`](../../interfaces/interfaces/ILeader.md)[]\> +`Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Returns an array with all the leader details. +Returns an array with all the operator details. **Code example** ```ts import { OperatorUtils, ChainId } from '@human-protocol/sdk'; -const filter: ILeadersFilter = { +const filter: IOperatorsFilter = { chainId: ChainId.POLYGON }; -const leaders = await OperatorUtils.getLeaders(filter); +const operators = await OperatorUtils.getOperators(filter); ``` -#### Defined in - -[operator.ts:107](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L107) - *** ### getReputationNetworkOperators() > `static` **getReputationNetworkOperators**(`chainId`, `address`, `role`?): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> +Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) + Retrieves the reputation network operators of the specified address. #### Parameters @@ -135,16 +135,14 @@ import { OperatorUtils, ChainId } from '@human-protocol/sdk'; const operators = await OperatorUtils.getReputationNetworkOperators(ChainId.POLYGON_AMOY, '0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[operator.ts:186](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L186) - *** ### getRewards() > `static` **getRewards**(`chainId`, `slasherAddress`): `Promise`\<[`IReward`](../../interfaces/interfaces/IReward.md)[]\> +Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) + This function returns information about the rewards for a given slasher address. #### Parameters @@ -174,7 +172,3 @@ import { OperatorUtils, ChainId } from '@human-protocol/sdk'; const rewards = await OperatorUtils.getRewards(ChainId.POLYGON_AMOY, '0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` - -#### Defined in - -[operator.ts:236](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L236) diff --git a/docs/sdk/typescript/staking/README.md b/docs/sdk/typescript/staking/README.md index 3618a4695f..78084c2f17 100644 --- a/docs/sdk/typescript/staking/README.md +++ b/docs/sdk/typescript/staking/README.md @@ -6,8 +6,6 @@ # staking -## Index - -### Classes +## Classes - [StakingClient](classes/StakingClient.md) diff --git a/docs/sdk/typescript/staking/classes/StakingClient.md b/docs/sdk/typescript/staking/classes/StakingClient.md index ca676e60f0..5065b6941f 100644 --- a/docs/sdk/typescript/staking/classes/StakingClient.md +++ b/docs/sdk/typescript/staking/classes/StakingClient.md @@ -6,6 +6,8 @@ # Class: StakingClient +Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) + ## Introduction This client enables performing actions on staking contracts and obtaining staking information from both the contracts and subgraph. @@ -84,6 +86,8 @@ const stakingClient = await StakingClient.build(provider); > **new StakingClient**(`runner`, `networkData`): [`StakingClient`](StakingClient.md) +Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) + **StakingClient constructor** #### Parameters @@ -108,19 +112,13 @@ The network information required to connect to the Staking contract [`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) -#### Defined in - -[staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) - ## Properties ### escrowFactoryContract > **escrowFactoryContract**: `EscrowFactory` -#### Defined in - -[staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) +Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) *** @@ -128,13 +126,11 @@ The network information required to connect to the Staking contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -#### Inherited from - -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) -#### Defined in +#### Inherited from -[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) *** @@ -142,13 +138,11 @@ The network information required to connect to the Staking contract > `protected` **runner**: `ContractRunner` -#### Inherited from +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) - -#### Defined in +#### Inherited from -[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) *** @@ -156,9 +150,7 @@ The network information required to connect to the Staking contract > **stakingContract**: `Staking` -#### Defined in - -[staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) +Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) *** @@ -166,9 +158,7 @@ The network information required to connect to the Staking contract > **tokenContract**: `HMToken` -#### Defined in - -[staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) +Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) ## Methods @@ -176,6 +166,8 @@ The network information required to connect to the Staking contract > **approveStake**(`amount`, `txOptions`?): `Promise`\<`void`\> +Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) + This function approves the staking contract to transfer a specified amount of tokens when the user stakes. It increases the allowance for the staking contract. #### Parameters @@ -215,16 +207,14 @@ const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI await stakingClient.approveStake(amount); ``` -#### Defined in - -[staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) - *** ### getStakerInfo() > **getStakerInfo**(`stakerAddress`): `Promise`\<[`StakerInfo`](../../interfaces/interfaces/StakerInfo.md)\> +Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) + Retrieves comprehensive staking information for a staker. #### Parameters @@ -253,16 +243,14 @@ const stakingInfo = await stakingClient.getStakerInfo('0xYourStakerAddress'); console.log(stakingInfo.tokensStaked); ``` -#### Defined in - -[staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) - *** ### slash() > **slash**(`slasher`, `staker`, `escrowAddress`, `amount`, `txOptions`?): `Promise`\<`void`\> +Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) + 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 @@ -320,16 +308,14 @@ const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI await stakingClient.slash('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount); ``` -#### Defined in - -[staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) - *** ### stake() > **stake**(`amount`, `txOptions`?): `Promise`\<`void`\> +Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) + This function stakes a specified amount of tokens on a specific network. > `approveStake` must be called before @@ -372,16 +358,14 @@ await stakingClient.approveStake(amount); // if it was already approved before, await stakingClient.stake(amount); ``` -#### Defined in - -[staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) - *** ### unstake() > **unstake**(`amount`, `txOptions`?): `Promise`\<`void`\> +Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) + This function unstakes tokens from staking contract. The unstaked tokens stay locked for a period of time. > Must have tokens available to unstake @@ -423,16 +407,14 @@ const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI await stakingClient.unstake(amount); ``` -#### Defined in - -[staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) - *** ### withdraw() > **withdraw**(`txOptions`?): `Promise`\<`void`\> +Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) + This function withdraws unstaked and non-locked tokens from staking contract to the user wallet. > Must have tokens available to withdraw @@ -467,16 +449,14 @@ const stakingClient = await StakingClient.build(signer); await stakingClient.withdraw(); ``` -#### Defined in - -[staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) - *** ### build() > `static` **build**(`runner`): `Promise`\<[`StakingClient`](StakingClient.md)\> +Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) + Creates an instance of StakingClient from a Runner. #### Parameters @@ -500,7 +480,3 @@ The Runner object to interact with the Ethereum network #### Throws - Thrown if the network's chainId is not supported - -#### Defined in - -[staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) diff --git a/docs/sdk/typescript/statistics/README.md b/docs/sdk/typescript/statistics/README.md index a4db8cb869..e40888e983 100644 --- a/docs/sdk/typescript/statistics/README.md +++ b/docs/sdk/typescript/statistics/README.md @@ -6,8 +6,6 @@ # statistics -## Index - -### Classes +## Classes - [StatisticsClient](classes/StatisticsClient.md) diff --git a/docs/sdk/typescript/statistics/classes/StatisticsClient.md b/docs/sdk/typescript/statistics/classes/StatisticsClient.md index d687f10c01..6bd87f6e83 100644 --- a/docs/sdk/typescript/statistics/classes/StatisticsClient.md +++ b/docs/sdk/typescript/statistics/classes/StatisticsClient.md @@ -6,6 +6,8 @@ # Class: StatisticsClient +Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) + ## Introduction This client enables obtaining statistical information from the subgraph. @@ -43,6 +45,8 @@ const statisticsClient = new StatisticsClient(NETWORKS[ChainId.POLYGON_AMOY]); > **new StatisticsClient**(`networkData`): [`StatisticsClient`](StatisticsClient.md) +Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) + **StatisticsClient constructor** #### Parameters @@ -57,19 +61,13 @@ The network information required to connect to the Statistics contract [`StatisticsClient`](StatisticsClient.md) -#### Defined in - -[statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) - ## Properties ### networkData > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -#### Defined in - -[statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) +Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) *** @@ -77,9 +75,7 @@ The network information required to connect to the Statistics contract > **subgraphUrl**: `string` -#### Defined in - -[statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) +Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) ## Methods @@ -87,6 +83,8 @@ The network information required to connect to the Statistics contract > **getEscrowStatistics**(`filter`): `Promise`\<[`EscrowStatistics`](../../graphql/types/type-aliases/EscrowStatistics.md)\> +Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) + This function returns the statistical data of escrows. **Input parameters** @@ -145,16 +143,14 @@ const escrowStatisticsApril = await statisticsClient.getEscrowStatistics({ }); ``` -#### Defined in - -[statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) - *** ### getHMTDailyData() > **getHMTDailyData**(`filter`): `Promise`\<[`DailyHMTData`](../../graphql/types/type-aliases/DailyHMTData.md)[]\> +Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) + This function returns the statistical data of HMToken day by day. **Input parameters** @@ -212,16 +208,14 @@ const hmtStatisticsRange = await statisticsClient.getHMTStatistics({ console.log('HMT statistics from 5/8 - 6/8:', hmtStatisticsRange); ``` -#### Defined in - -[statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) - *** ### getHMTHolders() > **getHMTHolders**(`params`): `Promise`\<[`HMTHolder`](../../graphql/types/type-aliases/HMTHolder.md)[]\> +Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) + This function returns the holders of the HMToken with optional filters and ordering. **Input parameters** @@ -257,16 +251,14 @@ console.log('HMT holders:', hmtHolders.map((h) => ({ }))); ``` -#### Defined in - -[statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) - *** ### getHMTStatistics() > **getHMTStatistics**(): `Promise`\<[`HMTStatistics`](../../graphql/types/type-aliases/HMTStatistics.md)\> +Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) + This function returns the statistical data of HMToken. ```ts @@ -298,16 +290,14 @@ console.log('HMT statistics:', { }); ``` -#### Defined in - -[statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) - *** ### getPaymentStatistics() > **getPaymentStatistics**(`filter`): `Promise`\<[`PaymentStatistics`](../../graphql/types/type-aliases/PaymentStatistics.md)\> +Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) + This function returns the statistical data of payments. **Input parameters** @@ -384,16 +374,14 @@ console.log( ); ``` -#### Defined in - -[statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) - *** ### getWorkerStatistics() > **getWorkerStatistics**(`filter`): `Promise`\<[`WorkerStatistics`](../../graphql/types/type-aliases/WorkerStatistics.md)\> +Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) + This function returns the statistical data of workers. **Input parameters** @@ -446,7 +434,3 @@ const workerStatisticsApril = await statisticsClient.getWorkerStatistics({ to: new Date('2021-04-30'), }); ``` - -#### Defined in - -[statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) diff --git a/docs/sdk/typescript/storage/README.md b/docs/sdk/typescript/storage/README.md index c77d810c8c..c36d3267b7 100644 --- a/docs/sdk/typescript/storage/README.md +++ b/docs/sdk/typescript/storage/README.md @@ -6,8 +6,6 @@ # storage -## Index +## Classes -### Classes - -- [StorageClient](classes/StorageClient.md) +- [~~StorageClient~~](classes/StorageClient.md) diff --git a/docs/sdk/typescript/storage/classes/StorageClient.md b/docs/sdk/typescript/storage/classes/StorageClient.md index 4aa78eddb7..6ce1cde592 100644 --- a/docs/sdk/typescript/storage/classes/StorageClient.md +++ b/docs/sdk/typescript/storage/classes/StorageClient.md @@ -6,6 +6,8 @@ # Class: ~~StorageClient~~ +Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) + ## Deprecated StorageClient is deprecated. Use Minio.Client directly. @@ -59,6 +61,8 @@ const storageClient = new StorageClient(params, credentials); > **new StorageClient**(`params`, `credentials`?): [`StorageClient`](StorageClient.md) +Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) + **Storage client constructor** #### Parameters @@ -79,16 +83,14 @@ Optional. Cloud storage access data. If credentials are not provided - use anony [`StorageClient`](StorageClient.md) -#### Defined in - -[storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) - ## Methods ### ~~bucketExists()~~ > **bucketExists**(`bucket`): `Promise`\<`boolean`\> +Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) + This function checks if a bucket exists. #### Parameters @@ -125,16 +127,14 @@ const storageClient = new StorageClient(params, credentials); const exists = await storageClient.bucketExists('bucket-name'); ``` -#### Defined in - -[storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) - *** ### ~~downloadFiles()~~ > **downloadFiles**(`keys`, `bucket`): `Promise`\<`any`[]\> +Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) + This function downloads files from a bucket. #### Parameters @@ -175,16 +175,14 @@ const keys = ['file1.json', 'file2.json']; const files = await storageClient.downloadFiles(keys, 'bucket-name'); ``` -#### Defined in - -[storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) - *** ### ~~listObjects()~~ > **listObjects**(`bucket`): `Promise`\<`string`[]\> +Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) + This function lists all file names contained in the bucket. #### Parameters @@ -221,16 +219,14 @@ const storageClient = new StorageClient(params, credentials); const fileNames = await storageClient.listObjects('bucket-name'); ``` -#### Defined in - -[storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) - *** ### ~~uploadFiles()~~ > **uploadFiles**(`files`, `bucket`): `Promise`\<[`UploadFile`](../../types/type-aliases/UploadFile.md)[]\> +Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) + This function uploads files to a bucket. #### Parameters @@ -276,16 +272,14 @@ const files = [file1, file2]; const uploadedFiles = await storageClient.uploadFiles(files, 'bucket-name'); ``` -#### Defined in - -[storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) - *** ### ~~downloadFileFromUrl()~~ > `static` **downloadFileFromUrl**(`url`): `Promise`\<`any`\> +Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) + This function downloads files from a URL. #### Parameters @@ -309,7 +303,3 @@ import { StorageClient } from '@human-protocol/sdk'; const file = await StorageClient.downloadFileFromUrl('http://localhost/file.json'); ``` - -#### Defined in - -[storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) diff --git a/docs/sdk/typescript/transaction/README.md b/docs/sdk/typescript/transaction/README.md index 7a6bf57441..23e8276725 100644 --- a/docs/sdk/typescript/transaction/README.md +++ b/docs/sdk/typescript/transaction/README.md @@ -6,8 +6,6 @@ # transaction -## Index - -### Classes +## Classes - [TransactionUtils](classes/TransactionUtils.md) diff --git a/docs/sdk/typescript/transaction/classes/TransactionUtils.md b/docs/sdk/typescript/transaction/classes/TransactionUtils.md index 0ccd68e25f..cb8ed148aa 100644 --- a/docs/sdk/typescript/transaction/classes/TransactionUtils.md +++ b/docs/sdk/typescript/transaction/classes/TransactionUtils.md @@ -6,6 +6,8 @@ # Class: TransactionUtils +Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) + ## Constructors ### new TransactionUtils() @@ -22,6 +24,8 @@ > `static` **getTransaction**(`chainId`, `hash`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)\> +Defined in: [transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) + This function returns the transaction data for the given hash. #### Parameters @@ -52,16 +56,14 @@ import { TransactionUtils, ChainId } from '@human-protocol/sdk'; const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` -#### Defined in - -[transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) - *** ### getTransactions() > `static` **getTransactions**(`filter`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)[]\> +Defined in: [transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) + This function returns all transaction details based on the provided filter. > This uses Subgraph @@ -124,7 +126,3 @@ const filter: ITransactionsFilter = { }; const transactions = await TransactionUtils.getTransactions(filter); ``` - -#### Defined in - -[transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 a6eef85112..87ec7b13af 100644 --- a/docs/sdk/typescript/types/README.md +++ b/docs/sdk/typescript/types/README.md @@ -6,18 +6,16 @@ # types -## Index - -### Enumerations +## Enumerations - [EscrowStatus](enumerations/EscrowStatus.md) -### Type Aliases +## Type Aliases - [EscrowCancel](type-aliases/EscrowCancel.md) - [EscrowWithdraw](type-aliases/EscrowWithdraw.md) - [NetworkData](type-aliases/NetworkData.md) -- [StorageCredentials](type-aliases/StorageCredentials.md) -- [StorageParams](type-aliases/StorageParams.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 935b608636..5db7ff8d60 100644 --- a/docs/sdk/typescript/types/enumerations/EscrowStatus.md +++ b/docs/sdk/typescript/types/enumerations/EscrowStatus.md @@ -6,6 +6,8 @@ # Enumeration: EscrowStatus +Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) + Enum for escrow statuses. ## Enumeration Members @@ -14,11 +16,9 @@ Enum for escrow statuses. > **Cancelled**: `5` -Escrow is cancelled. - -#### Defined in +Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) -[types.ts:32](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) +Escrow is cancelled. *** @@ -26,11 +26,9 @@ Escrow is cancelled. > **Complete**: `4` -Escrow is finished. - -#### Defined in +Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) -[types.ts:28](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) +Escrow is finished. *** @@ -38,11 +36,9 @@ Escrow is finished. > **Launched**: `0` -Escrow is launched. +Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) -#### Defined in - -[types.ts:12](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) +Escrow is launched. *** @@ -50,11 +46,9 @@ Escrow is launched. > **Paid**: `3` -Escrow is fully paid. - -#### Defined in +Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) -[types.ts:24](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) +Escrow is fully paid. *** @@ -62,11 +56,9 @@ Escrow is fully paid. > **Partial**: `2` -Escrow is partially paid out. - -#### Defined in +Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) -[types.ts:20](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) +Escrow is partially paid out. *** @@ -74,8 +66,6 @@ Escrow is partially paid out. > **Pending**: `1` -Escrow is funded, and waiting for the results to be submitted. - -#### Defined in +Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) -[types.ts:16](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) +Escrow is funded, and waiting for the results to be submitted. diff --git a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md index 084b9c436b..cf30dfbaa7 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md @@ -8,6 +8,8 @@ > **EscrowCancel**: `object` +Defined in: [types.ts:145](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) + Represents the response data for an escrow cancellation. ## Type declaration @@ -23,7 +25,3 @@ The amount refunded in the escrow cancellation. > **txHash**: `string` The hash of the transaction associated with the escrow cancellation. - -## Defined in - -[types.ts:145](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 c12e0205f1..4cdfe43b66 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md @@ -8,6 +8,8 @@ > **EscrowWithdraw**: `object` +Defined in: [types.ts:159](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) + Represents the response data for an escrow withdrawal. ## Type declaration @@ -29,7 +31,3 @@ The address of the token used for the withdrawal. > **txHash**: `string` The hash of the transaction associated with the escrow withdrawal. - -## Defined in - -[types.ts:159](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 eac2669da8..f00440d4e3 100644 --- a/docs/sdk/typescript/types/type-aliases/NetworkData.md +++ b/docs/sdk/typescript/types/type-aliases/NetworkData.md @@ -8,6 +8,8 @@ > **NetworkData**: `object` +Defined in: [types.ts:95](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) + Network data ## Type declaration @@ -77,7 +79,3 @@ Subgraph URL API key > **title**: `string` Network title - -## Defined in - -[types.ts:95](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 271aca0164..adea949f55 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md +++ b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md @@ -8,6 +8,8 @@ > `readonly` **StorageCredentials**: `object` +Defined in: [types.ts:40](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) + AWS/GCP cloud storage access data ## Type declaration @@ -27,7 +29,3 @@ Secret Key ## Deprecated StorageClient is deprecated. Use Minio.Client directly. - -## Defined in - -[types.ts:40](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 4a0abd700b..c237594091 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageParams.md +++ b/docs/sdk/typescript/types/type-aliases/StorageParams.md @@ -8,6 +8,8 @@ > **StorageParams**: `object` +Defined in: [types.ts:54](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) + ## Type declaration ### ~~endPoint~~ @@ -37,7 +39,3 @@ Enable secure (HTTPS) access. Default value set to false ## Deprecated StorageClient is deprecated. Use Minio.Client directly. - -## Defined in - -[types.ts:54](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 index b367900e4b..d329c39cb9 100644 --- a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md +++ b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md @@ -8,12 +8,10 @@ > **TransactionLikeWithNonce**: `TransactionLike` & `object` +Defined in: [types.ts:174](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L174) + ## Type declaration ### nonce > **nonce**: `number` - -## Defined in - -[types.ts:174](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/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 0d4750c677..118d2c8051 100644 --- a/docs/sdk/typescript/types/type-aliases/UploadFile.md +++ b/docs/sdk/typescript/types/type-aliases/UploadFile.md @@ -8,6 +8,8 @@ > `readonly` **UploadFile**: `object` +Defined in: [types.ts:77](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) + Upload file data ## Type declaration @@ -29,7 +31,3 @@ Uploaded object key > **url**: `string` Uploaded object URL - -## Defined in - -[types.ts:77](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) diff --git a/package.json b/package.json index 212470ae4a..91a1a81845 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "devDependencies": { "@apollo/client": "^3.11.1", "@babel/core": "^7.23.5", - "@babel/preset-env": "^7.24.3", + "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@jest/globals": "^29.3.1", @@ -45,15 +45,10 @@ "typescript": "^5.6.3" }, "resolutions": { - "ejs": "^3.1.10", - "gluegun": "^5.0.0", - "mocha": "^10.0.0", - "node-fetch": "^2.6.7", - "node-forge": "^1.0.0", - "qrcode": "^1.5.0", - "semver": "^7.5.2", - "undici": "^6.11.1", - "ws": "^8.17.1", - "fast-xml-parser": "4.4.1" + "**/gluegun/ejs": "^3.1.10", + "**/gluegun/semver": "^7.5.2", + "**/@ethersproject/providers/ws": "^7.5.10", + "**/@graphql-tools/**/ws": "^8.17.1", + "**/hardhat-gas-reporter/viem": "^2.15.1" } } diff --git a/packages/apps/dashboard/client/package.json b/packages/apps/dashboard/client/package.json index a1a789fdb0..9ff13324a6 100644 --- a/packages/apps/dashboard/client/package.json +++ b/packages/apps/dashboard/client/package.json @@ -33,7 +33,6 @@ "react-number-format": "^5.4.3", "react-router-dom": "^6.23.1", "recharts": "^2.13.0-alpha.4", - "sass": "^1.83.4", "simplebar-react": "^3.2.5", "styled-components": "^6.1.11", "swiper": "^11.1.3", @@ -52,9 +51,9 @@ "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.11", "prettier": "3.4.2", - "sass": "^1.83.4", + "sass": "^1.85.0", "stylelint-prettier": "^5.0.0", - "typescript": "^5.2.2", + "typescript": "^5.6.3", "vite": "^5.4.7", "vite-plugin-svgr": "^4.2.0" } diff --git a/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetails.tsx b/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetails.tsx index 3ef6723c0f..24f69c717a 100644 --- a/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetails.tsx +++ b/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetails.tsx @@ -9,7 +9,7 @@ import ExchangeOracleIcon from '@assets/icons/exchange-oracle.svg'; import JobLauncherIcon from '@assets/icons/job-launcher.svg'; import RecordingOracleIcon from '@assets/icons/recording-oracle.svg'; import HelpOutlineIcon from '@mui/icons-material/HelpOutline'; -import { AddressDetailsLeader } from '@services/api/use-address-details'; +import { AddressDetailsOperator } from '@services/api/use-address-details'; import { getNetwork } from '@utils/config/networks'; import { useWalletSearch } from '@utils/hooks/use-wallet-search'; import { RoleDetailsEscrowsTable } from '@pages/SearchResults/RoleDetails/RoleDetailsEscrows/RoleDetailsEscrowsTable'; @@ -48,7 +48,7 @@ const RoleInformation = ({ title, points }: RoleInfoProps) => { const RenderRoleDetailsInfo = ({ role, }: { - role: AddressDetailsLeader['role']; + role: AddressDetailsOperator['role']; }) => { if (!role) { return null; @@ -151,7 +151,7 @@ const renderReputationTitle = (reputation: Reputation) => { ); }; -const renderRoleIcon = (role: AddressDetailsLeader['role']) => { +const renderRoleIcon = (role: AddressDetailsOperator['role']) => { if (!role) return null; const roleIcons = { [Role.ReputationOracle]: , @@ -173,7 +173,7 @@ const RoleDetails = ({ amountLocked, }, }: { - data: AddressDetailsLeader; + data: AddressDetailsOperator; }) => { const { filterParams } = useWalletSearch(); diff --git a/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetailsEscrows/RoleDetailsEscrowsTable.tsx b/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetailsEscrows/RoleDetailsEscrowsTable.tsx index 89d05a56f7..9a01f47b1c 100644 --- a/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetailsEscrows/RoleDetailsEscrowsTable.tsx +++ b/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetailsEscrows/RoleDetailsEscrowsTable.tsx @@ -1,7 +1,7 @@ import Card from '@mui/material/Card'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; -import { AddressDetailsLeader } from '@services/api/use-address-details'; +import { AddressDetailsOperator } from '@services/api/use-address-details'; import TableContainer from '@mui/material/TableContainer'; import Table from '@mui/material/Table'; import { EscrowsTableBody } from '@pages/SearchResults/RoleDetails/RoleDetailsEscrows/tableComponents/EscrowsTableBody'; @@ -15,7 +15,7 @@ import { Stack } from '@mui/material'; export const RoleDetailsEscrowsTable = ({ role, }: { - role: AddressDetailsLeader['role']; + role: AddressDetailsOperator['role']; }) => { const { data } = useEscrowDetails({ role }); const { diff --git a/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetailsEscrows/tableComponents/EscrowsTableBody.tsx b/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetailsEscrows/tableComponents/EscrowsTableBody.tsx index 3e9847760c..153f8c0c76 100644 --- a/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetailsEscrows/tableComponents/EscrowsTableBody.tsx +++ b/packages/apps/dashboard/client/src/pages/SearchResults/RoleDetails/RoleDetailsEscrows/tableComponents/EscrowsTableBody.tsx @@ -5,7 +5,7 @@ import { handleErrorMessage } from '@services/handle-error-message'; import CircularProgress from '@mui/material/CircularProgress'; import { EscrowsTableBodyContainer } from '@pages/SearchResults/RoleDetails/RoleDetailsEscrows/tableComponents/EscrowsTableBodyContainer'; import { useEscrowDetails } from '@services/api/use-escrows-details'; -import { AddressDetailsLeader } from '@services/api/use-address-details'; +import { AddressDetailsOperator } from '@services/api/use-address-details'; import { useEscrowDetailsDto } from '@utils/hooks/use-escrows-details-dto'; import { useWalletSearch } from '@utils/hooks/use-wallet-search'; import { useNavigate } from 'react-router-dom'; @@ -15,7 +15,7 @@ import Link from '@mui/material/Link'; export const EscrowsTableBody = ({ role, }: { - role: AddressDetailsLeader['role']; + role: AddressDetailsOperator['role']; }) => { const navigate = useNavigate(); const { filterParams } = useWalletSearch(); diff --git a/packages/apps/dashboard/client/src/pages/SearchResults/SearchResults.tsx b/packages/apps/dashboard/client/src/pages/SearchResults/SearchResults.tsx index a171a4c56a..9c3db5f7f4 100644 --- a/packages/apps/dashboard/client/src/pages/SearchResults/SearchResults.tsx +++ b/packages/apps/dashboard/client/src/pages/SearchResults/SearchResults.tsx @@ -35,7 +35,7 @@ const renderCurrentResultType = ( keyof AddressDetails, { title: string; icon: JSX.Element } > = { - leader: { + operator: { title: 'Wallet Address', icon: , }, @@ -86,7 +86,7 @@ const Results = () => { const selectedWalletData: AddressDetailsWallet | undefined = data.wallet || - (data.leader && data.leader.role === null ? data.leader : undefined); + (data.operator && data.operator.role === null ? data.operator : undefined); return ( <> @@ -99,8 +99,8 @@ const Results = () => { {renderCurrentResultType(data, filterParams.address)} - {data.leader && data.leader.role ? ( - + {data.operator && data.operator.role ? ( + ) : null} {selectedWalletData ? : null} {data.escrow ? : null} diff --git a/packages/apps/dashboard/client/src/services/api-paths.ts b/packages/apps/dashboard/client/src/services/api-paths.ts index 79e0f82eb5..656a08c685 100644 --- a/packages/apps/dashboard/client/src/services/api-paths.ts +++ b/packages/apps/dashboard/client/src/services/api-paths.ts @@ -15,7 +15,7 @@ export const apiPaths = { path: '/stats/hcaptcha/daily', }, leaderboardDetails: { - path: '/details/leaders', + path: '/details/operators', }, addressDetails: { path: '/details', diff --git a/packages/apps/dashboard/client/src/services/api/use-address-details.tsx b/packages/apps/dashboard/client/src/services/api/use-address-details.tsx index 14c443170a..258b3588cc 100644 --- a/packages/apps/dashboard/client/src/services/api/use-address-details.tsx +++ b/packages/apps/dashboard/client/src/services/api/use-address-details.tsx @@ -64,7 +64,7 @@ const escrowSchema = z.object({ export type AddressDetailsEscrowSchema = z.infer; -const leaderSchema = z.object({ +const operatorSchema = z.object({ chainId: z.number(), address: z.string(), balance: z.string().transform(transformOptionalTokenAmount), @@ -87,12 +87,12 @@ const leaderSchema = z.object({ amountJobsProcessed: z.string(), }); -export type AddressDetailsLeader = z.infer; +export type AddressDetailsOperator = z.infer; const addressDetailsResponseSchema = z.object({ wallet: z.optional(walletSchema), escrow: z.optional(escrowSchema), - leader: z.optional(leaderSchema), + operator: z.optional(operatorSchema), }); export type AddressDetails = z.infer; diff --git a/packages/apps/dashboard/client/src/services/api/use-escrows-details.tsx b/packages/apps/dashboard/client/src/services/api/use-escrows-details.tsx index 402e78bd72..f724d3cea8 100644 --- a/packages/apps/dashboard/client/src/services/api/use-escrows-details.tsx +++ b/packages/apps/dashboard/client/src/services/api/use-escrows-details.tsx @@ -5,7 +5,7 @@ import { apiPaths } from '../api-paths'; import { useWalletSearch } from '@utils/hooks/use-wallet-search'; import { validateResponse } from '@services/validate-response'; import { useEscrowDetailsDto } from '@utils/hooks/use-escrows-details-dto'; -import { AddressDetailsLeader } from '@services/api/use-address-details'; +import { AddressDetailsOperator } from '@services/api/use-address-details'; const escrowDetailsSuccessResponseSchema = z.object({ chainId: z.number(), @@ -33,13 +33,13 @@ export interface PaginatedEscrowsDetailsDto { skip: number; first: number; chainId: number; - role: AddressDetailsLeader['role']; + role: AddressDetailsOperator['role']; } export function useEscrowDetails({ role, }: { - role: AddressDetailsLeader['role']; + role: AddressDetailsOperator['role']; }) { const { filterParams } = useWalletSearch(); const { diff --git a/packages/apps/dashboard/client/src/utils/config/networks.ts b/packages/apps/dashboard/client/src/utils/config/networks.ts index db3fd5cdda..bb1839642d 100644 --- a/packages/apps/dashboard/client/src/utils/config/networks.ts +++ b/packages/apps/dashboard/client/src/utils/config/networks.ts @@ -6,7 +6,28 @@ import { env } from '@helpers/env'; const ENABLED_CHAIN_IDS = env.VITE_ENABLED_CHAIN_IDS; const chainIdsList = ENABLED_CHAIN_IDS.split(',').map((id) => parseInt(id, 10)); -const viemChains = Object.values(chains); +const LOCALHOST = { + id: 1338, + name: 'Localhost', + network: 'localhost', + nativeCurrency: { + decimals: 18, + name: 'Ether', + symbol: 'ETH', + }, + rpcUrls: { + default: { + http: ['http://127.0.0.1:8545'], + }, + public: { + http: ['http://127.0.0.1:8545'], + }, + }, +}; + +const viemChains = Object.values(chains).map((chain) => + chain.id === 1338 ? LOCALHOST : chain +); export const getNetwork = (chainId: number): Chain | undefined => viemChains.find((network) => { diff --git a/packages/apps/dashboard/server/src/app.module.ts b/packages/apps/dashboard/server/src/app.module.ts index 2017d3cf92..0f973c696c 100644 --- a/packages/apps/dashboard/server/src/app.module.ts +++ b/packages/apps/dashboard/server/src/app.module.ts @@ -24,7 +24,7 @@ import { NetworksModule } from './modules/networks/networks.module'; PORT: Joi.number().port().default(3000), REDIS_HOST: Joi.string(), REDIS_PORT: Joi.number(), - SUBGRAPH_API_KEY: Joi.string().required(), + SUBGRAPH_API_KEY: Joi.string(), HCAPTCHA_API_KEY: Joi.string().required(), CACHE_HMT_PRICE_TTL: Joi.number(), CACHE_HMT_GENERAL_STATS_TTL: Joi.number(), diff --git a/packages/apps/dashboard/server/src/common/config/env-config.service.ts b/packages/apps/dashboard/server/src/common/config/env-config.service.ts index 24bcf0af71..a7b5a6cb49 100644 --- a/packages/apps/dashboard/server/src/common/config/env-config.service.ts +++ b/packages/apps/dashboard/server/src/common/config/env-config.service.ts @@ -45,7 +45,7 @@ export class EnvironmentConfigService { ); } get subgraphApiKey(): string { - return this.configService.getOrThrow('SUBGRAPH_API_KEY'); + return this.configService.get('SUBGRAPH_API_KEY', ''); } get hmtPriceSource(): string { return this.configService.get( diff --git a/packages/apps/dashboard/server/src/common/constants/leader.ts b/packages/apps/dashboard/server/src/common/constants/operator.ts similarity index 100% rename from packages/apps/dashboard/server/src/common/constants/leader.ts rename to packages/apps/dashboard/server/src/common/constants/operator.ts diff --git a/packages/apps/dashboard/server/src/common/enums/leader.ts b/packages/apps/dashboard/server/src/common/enums/operator.ts similarity index 75% rename from packages/apps/dashboard/server/src/common/enums/leader.ts rename to packages/apps/dashboard/server/src/common/enums/operator.ts index 3885b97282..19adba29dd 100644 --- a/packages/apps/dashboard/server/src/common/enums/leader.ts +++ b/packages/apps/dashboard/server/src/common/enums/operator.ts @@ -1,4 +1,4 @@ -export enum LeadersOrderBy { +export enum OperatorsOrderBy { ROLE = 'role', AMOUNT_STAKED = 'amountStaked', REPUTATION = 'reputation', diff --git a/packages/apps/dashboard/server/src/common/types/index.ts b/packages/apps/dashboard/server/src/common/types/index.ts index d025f15457..5d8b821f3a 100644 --- a/packages/apps/dashboard/server/src/common/types/index.ts +++ b/packages/apps/dashboard/server/src/common/types/index.ts @@ -1 +1 @@ -export * from './leader'; +export * from './operator'; diff --git a/packages/apps/dashboard/server/src/common/types/leader.ts b/packages/apps/dashboard/server/src/common/types/leader.ts deleted file mode 100644 index 47dc7530ac..0000000000 --- a/packages/apps/dashboard/server/src/common/types/leader.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/common/types/operator.ts b/packages/apps/dashboard/server/src/common/types/operator.ts new file mode 100644 index 0000000000..45ae12e29e --- /dev/null +++ b/packages/apps/dashboard/server/src/common/types/operator.ts @@ -0,0 +1,8 @@ +import { OrderDirection } from '@human-protocol/sdk'; +import { OperatorsOrderBy } from '../enums/operator'; + +export type GetOperatorsPaginationOptions = { + orderBy?: OperatorsOrderBy; + 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 55441a0b0f..af15c4916d 100644 --- a/packages/apps/dashboard/server/src/modules/details/details.controller.ts +++ b/packages/apps/dashboard/server/src/modules/details/details.controller.ts @@ -20,11 +20,11 @@ import { import { DetailsTransactionsPaginationDto, DetailsEscrowsPaginationDto, - LeadersPaginationDto, + OperatorsPaginationDto, } from './dto/details-pagination.dto'; import { WalletDto } from './dto/wallet.dto'; import { EscrowDto, EscrowPaginationDto } from './dto/escrow.dto'; -import { LeaderDto } from './dto/leader.dto'; +import { OperatorDto } from './dto/operator.dto'; import { TransactionPaginationDto } from './dto/transaction.dto'; @ApiTags('Details') @@ -33,22 +33,22 @@ import { TransactionPaginationDto } from './dto/transaction.dto'; export class DetailsController { constructor(private readonly detailsService: DetailsService) {} - @Get('/leaders') + @Get('/operators') @HttpCode(200) @ApiOperation({ - summary: 'Get leaders', - description: 'Returns leaders for the given filters.', + summary: 'Get operators', + description: 'Returns operators for the given filters.', }) @ApiResponse({ status: 200, - description: 'Leaders retrieved successfully', - type: LeaderDto, + description: 'Operators retrieved successfully', + type: OperatorDto, isArray: true, }) - public async leaders( - @Query() query: LeadersPaginationDto, - ): Promise { - return this.detailsService.getLeaders(query.chainId, { + public async operators( + @Query() query: OperatorsPaginationDto, + ): Promise { + return this.detailsService.getOperators(query.chainId, { orderBy: query.orderBy, orderDirection: query.orderDirection, first: query.first, @@ -71,7 +71,7 @@ export class DetailsController { @Param('address', AddressValidationPipe) address: string, @Query('chainId') chainId: ChainId, ): Promise { - const details: WalletDto | EscrowDto | LeaderDto = + const details: WalletDto | EscrowDto | OperatorDto = await this.detailsService.getDetails(chainId, address); if (details instanceof WalletDto) { const response: DetailsResponseDto = { @@ -85,9 +85,9 @@ export class DetailsController { }; return response; } - if (details instanceof LeaderDto) { + if (details instanceof OperatorDto) { const response: DetailsResponseDto = { - leader: details, + operator: details, }; return response; } 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 66631e50ab..ddb88e7745 100644 --- a/packages/apps/dashboard/server/src/modules/details/details.service.ts +++ b/packages/apps/dashboard/server/src/modules/details/details.service.ts @@ -8,14 +8,14 @@ import { IEscrowsFilter, Role, NETWORKS, - ILeadersFilter, OrderDirection, KVStoreUtils, + IOperatorsFilter, } from '@human-protocol/sdk'; import { WalletDto } from './dto/wallet.dto'; import { EscrowDto, EscrowPaginationDto } from './dto/escrow.dto'; -import { LeaderDto } from './dto/leader.dto'; +import { OperatorDto } from './dto/operator.dto'; import { TransactionPaginationDto } from './dto/transaction.dto'; import { EnvironmentConfigService } from '../../common/config/env-config.service'; import { HttpService } from '@nestjs/axios'; @@ -23,13 +23,13 @@ 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 { LeadersOrderBy } from '../../common/enums/leader'; +import { OperatorsOrderBy } from '../../common/enums/operator'; import { ReputationLevel } from '../../common/enums/reputation'; import { MAX_LEADERS_COUNT, MIN_AMOUNT_STAKED, -} from '../../common/constants/leader'; -import { GetLeadersPaginationOptions } from 'src/common/types'; +} from '../../common/constants/operator'; +import { GetOperatorsPaginationOptions } from 'src/common/types'; import { KVStoreDataDto } from './dto/details-response.dto'; @Injectable() @@ -44,7 +44,7 @@ export class DetailsService { public async getDetails( chainId: ChainId, address: string, - ): Promise { + ): Promise { const escrowData = await EscrowUtils.getEscrow(chainId, address); if (escrowData) { const escrowDto: EscrowDto = plainToInstance(EscrowDto, escrowData, { @@ -52,19 +52,23 @@ export class DetailsService { }); return escrowDto; } - const leaderData = await OperatorUtils.getLeader(chainId, address); - if (leaderData) { - const leaderDto: LeaderDto = plainToInstance(LeaderDto, leaderData, { - excludeExtraneousValues: true, - }); + const operatorData = await OperatorUtils.getOperator(chainId, address); + if (operatorData) { + const operatorDto: OperatorDto = plainToInstance( + OperatorDto, + operatorData, + { + excludeExtraneousValues: true, + }, + ); - leaderDto.chainId = chainId; - leaderDto.balance = await this.getHmtBalance(chainId, address); + operatorDto.chainId = chainId; + operatorDto.balance = await this.getHmtBalance(chainId, address); const { reputation } = await this.fetchReputation(chainId, address); - leaderDto.reputation = reputation; + operatorDto.reputation = reputation; - return leaderDto; + return operatorDto; } const walletDto: WalletDto = plainToInstance(WalletDto, { chainId, @@ -156,56 +160,58 @@ export class DetailsService { return result; } - public async getLeaders( + public async getOperators( chainId: ChainId, - { orderBy, orderDirection, first }: GetLeadersPaginationOptions = {}, - ): Promise { - const filter = this.createLeadersFilter( + { orderBy, orderDirection, first }: GetOperatorsPaginationOptions = {}, + ): Promise { + const filter = this.createOperatorsFilter( chainId, orderBy, orderDirection, first, ); - const [rawLeaders, reputations] = await Promise.all([ - OperatorUtils.getLeaders(filter), + const [rawOperators, reputations] = await Promise.all([ + OperatorUtils.getOperators(filter), this.fetchReputations( chainId, orderBy, orderDirection, - orderBy === LeadersOrderBy.REPUTATION ? filter.first : undefined, + orderBy === OperatorsOrderBy.REPUTATION ? filter.first : undefined, ), ]); - const leaders = rawLeaders - .filter((leader) => leader.role) - .map((leader) => - plainToInstance(LeaderDto, leader, { excludeExtraneousValues: true }), + const operators = rawOperators + .filter((operator) => operator.role) + .map((operator) => + plainToInstance(OperatorDto, operator, { + excludeExtraneousValues: true, + }), ); - const leadersWithReputation = this.assignReputationsToLeaders( - leaders, + const operatorsWithReputation = this.assignReputationsToOperators( + operators, reputations, ); - if (orderBy === LeadersOrderBy.REPUTATION) { - return this.sortLeadersByReputation( - leadersWithReputation, + if (orderBy === OperatorsOrderBy.REPUTATION) { + return this.sortOperatorsByReputation( + operatorsWithReputation, orderDirection, first, ); } - return leadersWithReputation; + return operatorsWithReputation; } - private createLeadersFilter( + private createOperatorsFilter( chainId: ChainId, - orderBy: LeadersOrderBy, + orderBy: OperatorsOrderBy, orderDirection: OrderDirection, first?: number, - ): ILeadersFilter { - const leadersFilter: ILeadersFilter = { + ): IOperatorsFilter { + const operatorsFilter: IOperatorsFilter = { chainId, minAmountStaked: MIN_AMOUNT_STAKED, roles: [ @@ -216,17 +222,17 @@ export class DetailsService { ], }; - if (orderBy === LeadersOrderBy.REPUTATION) { - leadersFilter.first = MAX_LEADERS_COUNT; + if (orderBy === OperatorsOrderBy.REPUTATION) { + operatorsFilter.first = MAX_LEADERS_COUNT; } else { - Object.assign(leadersFilter, { + Object.assign(operatorsFilter, { orderBy, orderDirection, first, }); } - return leadersFilter; + return operatorsFilter; } private async fetchReputation( @@ -259,7 +265,7 @@ export class DetailsService { private async fetchReputations( chainId: ChainId, - orderBy?: LeadersOrderBy, + orderBy?: OperatorsOrderBy, orderDirection?: OrderDirection, first?: number, ): Promise<{ address: string; reputation: string }[]> { @@ -277,7 +283,7 @@ export class DetailsService { Role.ReputationOracle, ], ...(orderBy && - orderBy === LeadersOrderBy.REPUTATION && { + orderBy === OperatorsOrderBy.REPUTATION && { order_by: 'reputation_points', }), ...(orderDirection && { order_direction: orderDirection }), @@ -296,34 +302,34 @@ export class DetailsService { } } - private assignReputationsToLeaders( - leaders: LeaderDto[], + private assignReputationsToOperators( + operators: OperatorDto[], reputations: { address: string; reputation: string }[], - ): LeaderDto[] { + ): OperatorDto[] { const reputationMap = new Map( reputations.map((rep) => [rep.address.toLowerCase(), rep.reputation]), ); - leaders.forEach((leader) => { - const reputation = reputationMap.get(leader.address.toLowerCase()); - leader.reputation = reputation || ReputationLevel.LOW; + operators.forEach((operator) => { + const reputation = reputationMap.get(operator.address.toLowerCase()); + operator.reputation = reputation || ReputationLevel.LOW; }); - return leaders; + return operators; } - private sortLeadersByReputation( - leaders: LeaderDto[], + private sortOperatorsByReputation( + operators: OperatorDto[], orderDirection: OrderDirection, first?: number, - ): LeaderDto[] { + ): OperatorDto[] { const reputationOrder = { [ReputationLevel.LOW]: 1, [ReputationLevel.MEDIUM]: 2, [ReputationLevel.HIGH]: 3, }; - const sortedLeaders = leaders.sort((a, b) => { + const sortedOperators = operators.sort((a, b) => { const reputationA = reputationOrder[a.reputation || ReputationLevel.LOW]; const reputationB = reputationOrder[b.reputation || ReputationLevel.LOW]; @@ -335,10 +341,10 @@ export class DetailsService { }); if (first) { - return sortedLeaders.slice(0, first); + return sortedOperators.slice(0, first); } - return sortedLeaders; + return sortedOperators; } public async getKVStoreData( diff --git a/packages/apps/dashboard/server/src/modules/details/details.spec.ts b/packages/apps/dashboard/server/src/modules/details/details.spec.ts index 787ca4112a..0d0eaf51e6 100644 --- a/packages/apps/dashboard/server/src/modules/details/details.spec.ts +++ b/packages/apps/dashboard/server/src/modules/details/details.spec.ts @@ -7,25 +7,25 @@ import { Logger } from '@nestjs/common'; import { of, throwError } from 'rxjs'; import { ChainId, - ILeader, + IOperator, OperatorUtils, KVStoreUtils, OrderDirection, } from '@human-protocol/sdk'; -import { LeadersOrderBy } from '../../common/enums/leader'; +import { OperatorsOrderBy } from '../../common/enums/operator'; jest.mock('@human-protocol/sdk', () => ({ ...jest.requireActual('@human-protocol/sdk'), OperatorUtils: { - getLeaders: jest.fn(), + getOperators: jest.fn(), }, KVStoreUtils: { getKVStoreData: jest.fn(), }, })); -jest.mock('../../common/constants/leader', () => ({ - ...jest.requireActual('../../common/constants/leader'), +jest.mock('../../common/constants/operator', () => ({ + ...jest.requireActual('../../common/constants/operator'), MAX_LEADERS_COUNT: 5, })); @@ -65,18 +65,18 @@ describe('DetailsService', () => { httpService = module.get(HttpService); }); - it('should fetch and return leaders with reputations', async () => { - const mockLeaders = [{ address: '0x123', role: 'Reputation Oracle' }]; + it('should fetch and return operators with reputations', async () => { + const mockOperators = [{ address: '0x123', role: 'Reputation Oracle' }]; const mockReputations = [{ address: '0x123', reputation: 'hign' }]; jest - .spyOn(OperatorUtils, 'getLeaders') - .mockResolvedValue(mockLeaders as ILeader[]); + .spyOn(OperatorUtils, 'getOperators') + .mockResolvedValue(mockOperators as IOperator[]); jest .spyOn(httpService as any, 'get') .mockReturnValue(of({ data: mockReputations })); - const result = await service.getLeaders(ChainId.ALL); + const result = await service.getOperators(ChainId.ALL); expect(result).toEqual([ expect.objectContaining({ @@ -88,14 +88,14 @@ describe('DetailsService', () => { }); it('should handle missing reputation data gracefully', async () => { - const mockLeaders = [{ address: '0x456', role: 'Job Launcher' }]; + const mockOperators = [{ address: '0x456', role: 'Job Launcher' }]; jest - .spyOn(OperatorUtils, 'getLeaders') - .mockResolvedValue(mockLeaders as ILeader[]); + .spyOn(OperatorUtils, 'getOperators') + .mockResolvedValue(mockOperators as IOperator[]); jest.spyOn(httpService as any, 'get').mockReturnValue(of({ data: [] })); - const result = await service.getLeaders(ChainId.ALL); + const result = await service.getOperators(ChainId.ALL); expect(result).toEqual([ expect.objectContaining({ @@ -106,8 +106,8 @@ describe('DetailsService', () => { ]); }); - it('should return sorted leaders by reputation', async () => { - const mockLeaders = [ + it('should return sorted operators by reputation', async () => { + const mockOperators = [ { address: '0xA', role: 'Job Launcher' }, { address: '0xB', role: 'Exchange Oracle' }, { address: '0xC', role: 'Exchange Oracle' }, @@ -120,17 +120,17 @@ describe('DetailsService', () => { { address: '0xD', reputation: 'medium' }, ]; - const getLeadersSpy = jest.spyOn(OperatorUtils, 'getLeaders'); - getLeadersSpy.mockImplementation(async ({ first }) => { - return mockLeaders.slice(0, first) as ILeader[]; + const getOperatorsSpy = jest.spyOn(OperatorUtils, 'getOperators'); + getOperatorsSpy.mockImplementation(async ({ first }) => { + return mockOperators.slice(0, first) as IOperator[]; }); jest .spyOn(httpService as any, 'get') .mockReturnValue(of({ data: mockReputations })); - const result = await service.getLeaders(ChainId.POLYGON_AMOY, { - orderBy: LeadersOrderBy.REPUTATION, + const result = await service.getOperators(ChainId.POLYGON_AMOY, { + orderBy: OperatorsOrderBy.REPUTATION, orderDirection: OrderDirection.DESC, first: 5, }); @@ -139,7 +139,7 @@ describe('DetailsService', () => { expect(result[1].address).toBe('0xC'); expect(result[2].address).toBe('0xD'); expect(result.length).toBe(5); - expect(getLeadersSpy).toBeCalledWith( + expect(getOperatorsSpy).toBeCalledWith( expect.objectContaining({ first: 5, }), @@ -147,16 +147,16 @@ describe('DetailsService', () => { }); it('should handle errors when fetching reputations', async () => { - const mockLeaders = [{ address: '0x789', role: 'Recording Oracle' }]; + const mockOperators = [{ address: '0x789', role: 'Recording Oracle' }]; jest - .spyOn(OperatorUtils, 'getLeaders') - .mockResolvedValue(mockLeaders as ILeader[]); + .spyOn(OperatorUtils, 'getOperators') + .mockResolvedValue(mockOperators as IOperator[]); jest .spyOn(httpService, 'get') .mockReturnValue(throwError(() => new Error('API error'))); - const result = await service.getLeaders(ChainId.ALL); + const result = await service.getOperators(ChainId.ALL); expect(result).toEqual([ expect.objectContaining({ 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 08d4a2e69b..912e55a17a 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 @@ -1,20 +1,20 @@ +import { ChainId, OrderDirection } from '@human-protocol/sdk'; +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { Transform, Type } from 'class-transformer'; import { IsEnum, + IsIn, IsNumber, IsOptional, IsString, - Min, Max, - IsIn, + Min, } from 'class-validator'; -import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; -import { ChainId, OrderDirection } from '@human-protocol/sdk'; +import { OperatorsOrderBy } from '../../../common/enums/operator'; import { IsRoleValid } from './validation/role-validation'; -import { LeadersOrderBy } from 'src/common/enums/leader'; -export class LeadersPaginationDto { +export class OperatorsPaginationDto { @ApiProperty({ enum: ChainId }) @IsEnum(ChainId) @IsIn(Object.values(ChainId).filter((id) => id !== ChainId.ALL)) @@ -22,13 +22,13 @@ export class LeadersPaginationDto { public chainId: ChainId; @ApiPropertyOptional({ - enum: LeadersOrderBy, - default: LeadersOrderBy.AMOUNT_STAKED, + enum: OperatorsOrderBy, + default: OperatorsOrderBy.AMOUNT_STAKED, }) - @IsEnum(LeadersOrderBy) - @IsIn(Object.values(LeadersOrderBy)) + @IsEnum(OperatorsOrderBy) + @IsIn(Object.values(OperatorsOrderBy)) @IsOptional() - public orderBy?: LeadersOrderBy = LeadersOrderBy.AMOUNT_STAKED; + public orderBy?: OperatorsOrderBy = OperatorsOrderBy.AMOUNT_STAKED; @ApiPropertyOptional({ enum: OrderDirection, diff --git a/packages/apps/dashboard/server/src/modules/details/dto/details-response.dto.ts b/packages/apps/dashboard/server/src/modules/details/dto/details-response.dto.ts index f007cf5d9a..38d37873af 100644 --- a/packages/apps/dashboard/server/src/modules/details/dto/details-response.dto.ts +++ b/packages/apps/dashboard/server/src/modules/details/dto/details-response.dto.ts @@ -4,7 +4,7 @@ import { ChainId } from '@human-protocol/sdk'; import { EscrowDto, EscrowPaginationDto } from './escrow.dto'; import { TransactionPaginationDto } from './transaction.dto'; -import { LeaderDto } from './leader.dto'; +import { OperatorDto } from './operator.dto'; import { WalletDto } from './wallet.dto'; export class DetailsResponseDto { @@ -21,7 +21,7 @@ export class DetailsResponseDto { @ApiProperty() @ApiPropertyOptional() @IsOptional() - public leader?: LeaderDto; + public operator?: OperatorDto; } export class DetailsPaginationResponseDto { diff --git a/packages/apps/dashboard/server/src/modules/details/dto/leader.dto.ts b/packages/apps/dashboard/server/src/modules/details/dto/operator.dto.ts similarity index 98% rename from packages/apps/dashboard/server/src/modules/details/dto/leader.dto.ts rename to packages/apps/dashboard/server/src/modules/details/dto/operator.dto.ts index 0719913d06..7285006e02 100644 --- a/packages/apps/dashboard/server/src/modules/details/dto/leader.dto.ts +++ b/packages/apps/dashboard/server/src/modules/details/dto/operator.dto.ts @@ -10,7 +10,7 @@ import { import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { ChainId, Role } from '@human-protocol/sdk'; -export class LeaderDto { +export class OperatorDto { @ApiProperty({ example: ChainId.POLYGON_AMOY }) @IsEnum(ChainId) @Expose() diff --git a/packages/apps/dashboard/server/tsconfig.json b/packages/apps/dashboard/server/tsconfig.json index 0c289022ea..4ac4174ca9 100644 --- a/packages/apps/dashboard/server/tsconfig.json +++ b/packages/apps/dashboard/server/tsconfig.json @@ -6,7 +6,7 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "allowSyntheticDefaultImports": true, - "target": "es2017", + "target": "es2023", "sourceMap": true, "outDir": "./dist", "baseUrl": "./", diff --git a/packages/apps/faucet/server/tsconfig.json b/packages/apps/faucet/server/tsconfig.json index 1fe608c290..1dd6c28e27 100644 --- a/packages/apps/faucet/server/tsconfig.json +++ b/packages/apps/faucet/server/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2020", + "target": "es2023", "module": "commonjs", "moduleResolution": "node", "pretty": true, @@ -15,7 +15,6 @@ "skipLibCheck": true, "esModuleInterop": true, "outDir": "build", - "lib": ["es2020"], "useUnknownInCatchVariables": false, "strictNullChecks": false, "allowJs": true diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/constant/index.ts b/packages/apps/fortune/exchange-oracle/server/src/common/constant/index.ts index d083a54a22..f68848e847 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/constant/index.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/constant/index.ts @@ -11,10 +11,7 @@ export const TESTNET_CHAIN_IDS = [ ChainId.BSC_TESTNET, ChainId.SEPOLIA, ]; -export const MAINNET_CHAIN_IDS = [ - ChainId.POLYGON, - ChainId.BSC_MAINNET, -]; +export const MAINNET_CHAIN_IDS = [ChainId.POLYGON, ChainId.BSC_MAINNET]; export const JWT_KVSTORE_KEY = 'jwt_public_key'; export const KYC_APPROVED = 'approved'; diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/enums/webhook.ts b/packages/apps/fortune/exchange-oracle/server/src/common/enums/webhook.ts index 3ccc451afc..da81b02ebb 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/enums/webhook.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/enums/webhook.ts @@ -2,7 +2,7 @@ export enum EventType { ESCROW_CREATED = 'escrow_created', ESCROW_COMPLETED = 'escrow_completed', ESCROW_CANCELED = 'escrow_canceled', - TASK_CREATION_FAILED = 'task_creation_failed', + ESCROW_FAILED = 'escrow_failed', SUBMISSION_REJECTED = 'submission_rejected', SUBMISSION_IN_REVIEW = 'submission_in_review', } diff --git a/packages/apps/fortune/exchange-oracle/server/src/database/migrations/1739274494282-escrowFailed.ts b/packages/apps/fortune/exchange-oracle/server/src/database/migrations/1739274494282-escrowFailed.ts new file mode 100644 index 0000000000..a4c1e8e924 --- /dev/null +++ b/packages/apps/fortune/exchange-oracle/server/src/database/migrations/1739274494282-escrowFailed.ts @@ -0,0 +1,60 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class EscrowFailed1739274494282 implements MigrationInterface { + name = 'EscrowFailed1739274494282'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + ALTER TABLE "hmt"."webhooks" + ADD "failure_detail" character varying + `); + await queryRunner.query(` + ALTER TYPE "hmt"."webhooks_event_type_enum" + RENAME TO "webhooks_event_type_enum_old" + `); + await queryRunner.query(` + CREATE TYPE "hmt"."webhooks_event_type_enum" AS ENUM( + 'escrow_created', + 'escrow_completed', + 'escrow_canceled', + 'escrow_failed', + 'submission_rejected', + 'submission_in_review' + ) + `); + await queryRunner.query(` + ALTER TABLE "hmt"."webhooks" + ALTER COLUMN "event_type" TYPE "hmt"."webhooks_event_type_enum" USING "event_type"::"text"::"hmt"."webhooks_event_type_enum" + `); + await queryRunner.query(` + DROP TYPE "hmt"."webhooks_event_type_enum_old" + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + CREATE TYPE "hmt"."webhooks_event_type_enum_old" AS ENUM( + 'escrow_created', + 'escrow_completed', + 'escrow_canceled', + 'task_creation_failed', + 'submission_rejected', + 'submission_in_review' + ) + `); + await queryRunner.query(` + ALTER TABLE "hmt"."webhooks" + ALTER COLUMN "event_type" TYPE "hmt"."webhooks_event_type_enum_old" USING "event_type"::"text"::"hmt"."webhooks_event_type_enum_old" + `); + await queryRunner.query(` + DROP TYPE "hmt"."webhooks_event_type_enum" + `); + await queryRunner.query(` + ALTER TYPE "hmt"."webhooks_event_type_enum_old" + RENAME TO "webhooks_event_type_enum" + `); + await queryRunner.query(` + ALTER TABLE "hmt"."webhooks" DROP COLUMN "failure_detail" + `); + } +} diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.spec.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.spec.ts index 558f6d9152..2ffb5640db 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.spec.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.spec.ts @@ -43,7 +43,7 @@ jest.mock('@human-protocol/sdk', () => ({ build: jest.fn(), }, OperatorUtils: { - getLeader: jest.fn(), + getOperator: jest.fn(), }, StorageClient: { downloadFileFromUrl: jest.fn(), @@ -488,7 +488,7 @@ describe('JobService', () => { const recordingOracleURLMock = 'https://example.com/recordingoracle'; - OperatorUtils.getLeader = jest.fn().mockResolvedValue({ + OperatorUtils.getOperator = jest.fn().mockResolvedValue({ webhookUrl: recordingOracleURLMock, }); storageService.uploadJobSolutions = jest diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.ts index 2d77b9abcf..c718a6bcd4 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.ts @@ -343,45 +343,43 @@ export class JobService { escrowAddress: string, manifestUrl: string, ): Promise { - const manifestEncrypted = - await StorageClient.downloadFileFromUrl(manifestUrl); + let manifest: ManifestDto | null = null; - let manifest: ManifestDto | null; - if ( - typeof manifestEncrypted === 'string' && - EncryptionUtils.isEncrypted(manifestEncrypted) - ) { - try { + try { + const manifestEncrypted = + await StorageClient.downloadFileFromUrl(manifestUrl); + + if ( + typeof manifestEncrypted === 'string' && + EncryptionUtils.isEncrypted(manifestEncrypted) + ) { const encryption = await Encryption.build( this.pgpConfigService.privateKey!, this.pgpConfigService.passphrase, ); - const decryptedData = await encryption.decrypt(manifestEncrypted); manifest = JSON.parse(Buffer.from(decryptedData).toString()); - } catch { - throw new Error(ErrorJob.ManifestDecryptionFailed); - } - } else { - try { + } else { manifest = typeof manifestEncrypted === 'string' ? JSON.parse(manifestEncrypted) : manifestEncrypted; - } catch { - manifest = null; } + } catch { + manifest = null; } if (!manifest) { const webhook = new WebhookEntity(); webhook.escrowAddress = escrowAddress; webhook.chainId = chainId; - webhook.eventType = EventType.TASK_CREATION_FAILED; + webhook.eventType = EventType.ESCROW_FAILED; + webhook.failureDetail = ErrorJob.ManifestNotFound; await this.webhookRepository.createUnique(webhook); - throw new NotFoundException(ErrorJob.ManifestNotFound); - } else return manifest; + } + + return manifest; } } diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.dto.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.dto.ts index 4cdee48a46..1e4e05c22d 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.dto.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.dto.ts @@ -23,13 +23,23 @@ export class RejectionEventData { public assignments: AssignmentRejection[]; } +export class FailedEventData { + @ApiProperty() + @IsString() + @IsOptional() + reason?: string; +} + export class SolutionEventData { @ApiProperty({ name: 'solutions_url' }) @IsString() solutionsUrl: string; } -export type EventData = RejectionEventData | SolutionEventData; +export type EventData = + | FailedEventData + | RejectionEventData + | SolutionEventData; export class WebhookDto { @ApiProperty({ diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.entity.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.entity.ts index 05f0d5d164..5107b238fe 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.entity.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.entity.ts @@ -30,4 +30,7 @@ export class WebhookEntity extends BaseEntity { enum: WebhookStatus, }) public status: WebhookStatus = WebhookStatus.PENDING; + + @Column({ type: 'varchar', nullable: true }) + public failureDetail: string; } diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.spec.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.spec.ts index 87d5fe8b9e..4d1c3c4090 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.spec.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.spec.ts @@ -35,7 +35,7 @@ jest.mock('@human-protocol/sdk', () => ({ build: jest.fn(), }, OperatorUtils: { - getLeader: jest.fn(), + getOperator: jest.fn(), }, KVStoreUtils: { get: jest.fn(), @@ -171,10 +171,10 @@ describe('WebhookService', () => { const webhook: WebhookDto = { chainId, escrowAddress, - eventType: EventType.TASK_CREATION_FAILED, + eventType: EventType.ESCROW_FAILED, }; await expect(webhookService.handleWebhook(webhook)).rejects.toThrow( - 'Invalid webhook event type: task_creation_failed', + 'Invalid webhook event type: escrow_failed', ); }); }); @@ -246,14 +246,14 @@ describe('WebhookService', () => { .mockResolvedValue(JOB_LAUNCHER_WEBHOOK_URL), })); - (OperatorUtils.getLeader as any).mockResolvedValue({ + (OperatorUtils.getOperator as any).mockResolvedValue({ webhookUrl: JOB_LAUNCHER_WEBHOOK_URL, }); const result = await (webhookService as any).getOracleWebhookUrl( JOB_LAUNCHER_WEBHOOK_URL, ChainId.LOCALHOST, - EventType.TASK_CREATION_FAILED, + EventType.ESCROW_FAILED, ); expect(result).toBe(JOB_LAUNCHER_WEBHOOK_URL); @@ -266,7 +266,7 @@ describe('WebhookService', () => { .mockResolvedValue(MOCK_RECORDING_ORACLE_WEBHOOK_URL), })); - (OperatorUtils.getLeader as any).mockResolvedValue({ + (OperatorUtils.getOperator as any).mockResolvedValue({ webhookUrl: MOCK_RECORDING_ORACLE_WEBHOOK_URL, }); diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.ts index acde287478..0c1d6772a6 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.ts @@ -97,6 +97,11 @@ export class WebhookService { ), }; } + if (webhook.eventType === EventType.ESCROW_FAILED) { + webhookData.eventData = { + reason: webhook.failureDetail, + }; + } const transformedWebhook = CaseConverter.transformToSnakeCase(webhookData); const signedBody = await signMessage( @@ -154,7 +159,7 @@ export class WebhookService { const escrowClient = await EscrowClient.build(signer); let oracleAddress: string; switch (eventType) { - case EventType.TASK_CREATION_FAILED: + case EventType.ESCROW_FAILED: oracleAddress = await escrowClient.getJobLauncherAddress(escrowAddress); break; case EventType.SUBMISSION_IN_REVIEW: @@ -164,7 +169,7 @@ export class WebhookService { default: throw new BadRequestException('Invalid outgoing event type'); } - const oracle = await OperatorUtils.getLeader(chainId, oracleAddress); + const oracle = await OperatorUtils.getOperator(chainId, oracleAddress); const oracleWebhookUrl = oracle.webhookUrl; return oracleWebhookUrl; diff --git a/packages/apps/fortune/exchange-oracle/server/tsconfig.json b/packages/apps/fortune/exchange-oracle/server/tsconfig.json index 6de878cdf8..63d442695b 100644 --- a/packages/apps/fortune/exchange-oracle/server/tsconfig.json +++ b/packages/apps/fortune/exchange-oracle/server/tsconfig.json @@ -7,7 +7,7 @@ "experimentalDecorators": true, "allowSyntheticDefaultImports": true, "allowJs": true, - "target": "es2020", + "target": "es2023", "sourceMap": true, "outDir": "./dist", "baseUrl": "./", diff --git a/packages/apps/human-app/frontend/Dockerfile b/packages/apps/human-app/frontend/Dockerfile index 8473ebefe0..897270c46c 100644 --- a/packages/apps/human-app/frontend/Dockerfile +++ b/packages/apps/human-app/frontend/Dockerfile @@ -1,5 +1,5 @@ # Using bullseye instead of slim because it needs Python and build tools for node-gyp -FROM node:18-bullseye +FROM node:22.14-bullseye ARG APP_PATH=packages/apps/human-app/frontend # Create app directory diff --git a/packages/apps/human-app/frontend/src/modules/worker/components/profile/profile.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/components/profile/profile.page.tsx index 41425547d0..56eb56ff43 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/components/profile/profile.page.tsx +++ b/packages/apps/human-app/frontend/src/modules/worker/components/profile/profile.page.tsx @@ -14,23 +14,34 @@ import { useAuthenticatedUser } from '@/modules/auth/hooks/use-authenticated-use export function WorkerProfilePage() { const { user } = useAuthenticatedUser(); const isMobile = useIsMobile(); - const { isConnected } = useWalletConnect(); + const { isConnected, initializing, web3ProviderMutation } = + useWalletConnect(); const { showNotification } = useNotification(); - const setNotifications = () => { - if (user.wallet_address) { - return; + useEffect(() => { + if (initializing) return; + + if (!isConnected || !user.wallet_address) { + showNotification({ + type: TopNotificationType.WARNING, + message: t('worker.profile.topNotifications.completeSteps'), + }); } - showNotification({ - type: TopNotificationType.WARNING, - message: t('worker.profile.topNotifications.completeSteps'), - }); - }; - useEffect(() => { - setNotifications(); - // eslint-disable-next-line react-hooks/exhaustive-deps -- call this once - }, [isConnected]); + if (web3ProviderMutation.isError && web3ProviderMutation.failureReason) { + showNotification({ + type: TopNotificationType.WARNING, + message: web3ProviderMutation.failureReason.message, + }); + } + }, [ + isConnected, + initializing, + web3ProviderMutation.failureReason, + web3ProviderMutation.isError, + user.wallet_address, + showNotification, + ]); return ( { + const { registeredOracles } = useRegisteredOracles(); + + return Boolean(address && registeredOracles?.includes(address)); +}; diff --git a/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-instructions.tsx b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-instructions.tsx new file mode 100644 index 0000000000..afc0076a88 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-instructions.tsx @@ -0,0 +1,14 @@ +import { useState, useCallback } from 'react'; + +export function useOracleInstructions( + instructions?: string | URL | null | undefined +) { + const [hasViewedInstructions, setHasViewedInstructions] = useState(false); + + const handleInstructionsView = useCallback(() => { + window.open(instructions ?? '', '_blank'); + setHasViewedInstructions(true); + }, [instructions]); + + return { hasViewedInstructions, handleInstructionsView }; +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-registration-flow.tsx b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-registration-flow.tsx new file mode 100644 index 0000000000..31a1173fcf --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-registration-flow.tsx @@ -0,0 +1,21 @@ +import { useOracleInstructions } from './use-oracle-instructions'; +import { useOracleRegistration } from './use-oracle-registration'; + +export function useOracleRegistrationFlow( + address: string, + oracleInstructions?: string | URL | null | undefined +) { + const { handleRegistration, isRegistrationPending, registrationError } = + useOracleRegistration(address); + + const { hasViewedInstructions, handleInstructionsView } = + useOracleInstructions(oracleInstructions); + + return { + hasViewedInstructions, + handleInstructionsView, + handleRegistration, + isRegistrationPending, + registrationError, + }; +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-registration.tsx b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-registration.tsx new file mode 100644 index 0000000000..828fa67d69 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/hooks/use-oracle-registration.tsx @@ -0,0 +1,36 @@ +import { useCallback } from 'react'; +import { + type RegistrationInExchangeOracleDto, + useExchangeOracleRegistrationMutation, +} from '@/modules/worker/oracle-registration/sevices'; +import { useRegisteredOracles } from '@/shared/contexts/registered-oracles'; + +export function useOracleRegistration(oracleAddress: string | undefined) { + const { setRegisteredOracles } = useRegisteredOracles(); + const { + mutate: registerInOracle, + isPending: isRegistrationPending, + error: registrationError, + } = useExchangeOracleRegistrationMutation(); + + const handleRegistration = useCallback( + (data: RegistrationInExchangeOracleDto) => { + registerInOracle(data, { + onSuccess() { + if (oracleAddress) { + setRegisteredOracles((prev) => + prev ? [...prev, oracleAddress] : [oracleAddress] + ); + } + }, + }); + }, + [oracleAddress, registerInOracle, setRegisteredOracles] + ); + + return { + handleRegistration, + isRegistrationPending, + registrationError, + }; +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/index.ts b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/index.ts new file mode 100644 index 0000000000..251318e0b2 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/index.ts @@ -0,0 +1 @@ +export * from './registration.page'; diff --git a/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/registration-form.tsx b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/registration-form.tsx new file mode 100644 index 0000000000..d5f8a7b418 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/registration-form.tsx @@ -0,0 +1,70 @@ +import { Box, Stack } from '@mui/material'; +import { FormProvider, useForm } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { zodResolver } from '@hookform/resolvers/zod'; +import { Button } from '@/shared/components/ui/button'; +import { HCaptchaForm } from '@/shared/components/hcaptcha/h-captcha-form'; +import { + registrationInExchangeOracleDtoSchema, + type RegistrationInExchangeOracleDto, +} from './sevices'; +import { useOracleRegistrationFlow } from './hooks'; + +function useRegistrationForm(address: string) { + return useForm({ + defaultValues: { + // eslint-disable-next-line camelcase + oracle_address: address, + // eslint-disable-next-line camelcase + h_captcha_token: '', + }, + resolver: zodResolver(registrationInExchangeOracleDtoSchema), + }); +} + +export function RegistrationForm({ + address, + oracleInstructions, +}: Readonly<{ + address: string; + oracleInstructions: string | URL | null | undefined; +}>) { + const { t } = useTranslation(); + const methods = useRegistrationForm(address); + const { + hasViewedInstructions, + handleInstructionsView, + handleRegistration, + isRegistrationPending: isLoading, + registrationError: error, + } = useOracleRegistrationFlow(address, oracleInstructions); + + const handleSubmit = (event: React.FormEvent) => { + void methods.handleSubmit(handleRegistration)(event); + }; + + return ( + <> + + {t('worker.registrationInExchangeOracle.completeMessage')} + +
+ + + + +
+
+ + ); +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/registration.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/registration.page.tsx new file mode 100644 index 0000000000..e8288240b3 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/registration.page.tsx @@ -0,0 +1,70 @@ +import { Box, Grid, Paper, Stack } from '@mui/material'; +import { useTranslation } from 'react-i18next'; +import { Navigate, useParams } from 'react-router-dom'; +import { RegistrationForm } from '@/modules/worker/oracle-registration/registration-form'; +import { Loader } from '@/shared/components/ui/loader'; +import { routerPaths } from '@/router/router-paths'; +import { useGetOracles } from '../services/oracles'; +import { useIsAlreadyRegistered } from './hooks'; + +function isAddress(address: string | undefined): address is string { + return address !== undefined && address.length > 0; +} + +export function RegistrationPage() { + const { t } = useTranslation(); + const { address: oracleAddress } = useParams<{ address: string }>(); + const { data, isLoading } = useGetOracles(); + const isAlreadyRegistered = useIsAlreadyRegistered(oracleAddress); + + const oracleData = data?.find((o) => o.address === oracleAddress); + + if (oracleData === undefined || !isAddress(oracleAddress)) { + return ; + } + + if (isAlreadyRegistered) { + return ( + + ); + } + + return ( + + + + + {isLoading ? ( + + ) : ( + <> + + {t('worker.registrationInExchangeOracle.requiredMessage')} + + + + )} + + + + + ); +} diff --git a/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/sevices/index.ts b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/sevices/index.ts new file mode 100644 index 0000000000..aeaed03788 --- /dev/null +++ b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/sevices/index.ts @@ -0,0 +1 @@ +export * from './registration-in-exchange-oracles'; diff --git a/packages/apps/human-app/frontend/src/modules/worker/services/registration-in-exchange-oracles.ts b/packages/apps/human-app/frontend/src/modules/worker/oracle-registration/sevices/registration-in-exchange-oracles.ts similarity index 100% rename from packages/apps/human-app/frontend/src/modules/worker/services/registration-in-exchange-oracles.ts rename to packages/apps/human-app/frontend/src/modules/worker/oracle-registration/sevices/registration-in-exchange-oracles.ts diff --git a/packages/apps/human-app/frontend/src/modules/worker/views/registration/registration.page.tsx b/packages/apps/human-app/frontend/src/modules/worker/views/registration/registration.page.tsx deleted file mode 100644 index e207df2a26..0000000000 --- a/packages/apps/human-app/frontend/src/modules/worker/views/registration/registration.page.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import { useState, useEffect } from 'react'; -import { Box, Grid, Paper, Stack } from '@mui/material'; -import { FormProvider, useForm } from 'react-hook-form'; -import { useTranslation } from 'react-i18next'; -import { useNavigate, useParams } from 'react-router-dom'; -import { zodResolver } from '@hookform/resolvers/zod'; -import { HCaptchaForm } from '@/shared/components/hcaptcha/h-captcha-form'; -import { Button } from '@/shared/components/ui/button'; -import { - type RegistrationInExchangeOracleDto, - registrationInExchangeOracleDtoSchema, - useExchangeOracleRegistrationMutation, -} from '@/modules/worker/services/registration-in-exchange-oracles'; -import { useGetOracles } from '@/modules/worker/services/oracles'; -import { routerPaths } from '@/router/router-paths'; -import { useRegisteredOracles } from '@/shared/contexts/registered-oracles'; - -export function RegistrationPage() { - const navigate = useNavigate(); - const { address: oracleAddress } = useParams<{ address: string }>(); - const oracleData = useGetOracles().data?.find( - (oracle) => oracle.address === oracleAddress - ); - const { t } = useTranslation(); - const [hasClickedRegistrationLink, setHasClickedRegistrationLink] = - useState(false); - - const { registeredOracles, setRegisteredOracles } = useRegisteredOracles(); - - const methods = useForm({ - defaultValues: { - // eslint-disable-next-line camelcase - oracle_address: oracleAddress, - // eslint-disable-next-line camelcase - h_captcha_token: '', - }, - resolver: zodResolver(registrationInExchangeOracleDtoSchema), - }); - - const { - mutate: userRegistrationMutate, - isPending: isRegistrationInExchangeOraclePending, - error: registrationInExchangeOracleError, - } = useExchangeOracleRegistrationMutation(); - - const handleInstructionsLinkClick = () => { - window.open(oracleData?.registrationInstructions ?? '', '_blank'); - setHasClickedRegistrationLink(true); - }; - - const handleRegistrationComplete = ( - data: RegistrationInExchangeOracleDto - ) => { - userRegistrationMutate(data, { - onSuccess(_data) { - if (oracleAddress !== undefined) { - setRegisteredOracles((prevRegisteredOracles) => { - return prevRegisteredOracles - ? [...prevRegisteredOracles, oracleAddress] - : [oracleAddress]; - }); - } - navigate(`${routerPaths.worker.jobs}/${oracleAddress ?? ''}`, { - state: { - oracleAddress, - }, - }); - }, - }); - }; - - useEffect(() => { - if (oracleData === undefined) { - navigate(routerPaths.worker.jobsDiscovery); - } - }, [oracleData, navigate]); - - useEffect(() => { - if (registeredOracles?.find((a) => a === oracleAddress)) { - navigate(`${routerPaths.worker.jobs}/${oracleAddress ?? ''}`, { - state: { - oracleAddress, - }, - }); - } - }, [registeredOracles, oracleAddress, navigate]); - - return ( - - - - - - {t('worker.registrationInExchangeOracle.requiredMessage')} - - - - {t('worker.registrationInExchangeOracle.completeMessage')} - - -
- void methods.handleSubmit(handleRegistrationComplete)(event) - } - > - - - - -
-
-
-
-
-
- ); -} diff --git a/packages/apps/human-app/frontend/src/router/routes.tsx b/packages/apps/human-app/frontend/src/router/routes.tsx index 51353392bd..2c1f9dc3d9 100644 --- a/packages/apps/human-app/frontend/src/router/routes.tsx +++ b/packages/apps/human-app/frontend/src/router/routes.tsx @@ -8,7 +8,7 @@ import { ResetPasswordWorkerSuccessPage } from '@/modules/worker/views/reset-pas import { JobsDiscoveryPage } from '@/modules/worker/views/jobs-discovery/jobs-discovery.page'; import { JobsPage } from '@/modules/worker/views/jobs/jobs.page'; import { env } from '@/shared/env'; -import { RegistrationPage } from '@/modules/worker/views/registration/registration.page'; +import { RegistrationPage } from '@/modules/worker/oracle-registration'; import { WorkerProfilePage } from '@/modules/worker/components/profile/profile.page'; import { HandIcon, diff --git a/packages/apps/human-app/server/Dockerfile b/packages/apps/human-app/server/Dockerfile index 6e355e5ccb..e059692fab 100644 --- a/packages/apps/human-app/server/Dockerfile +++ b/packages/apps/human-app/server/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18-slim +FROM node:22.14-slim ARG APP_PATH=packages/apps/human-app/server # Create app directory diff --git a/packages/apps/human-app/server/src/modules/oracle-discovery/model/oracle-discovery.model.ts b/packages/apps/human-app/server/src/modules/oracle-discovery/model/oracle-discovery.model.ts index d2df12edca..a306dc0b3c 100644 --- a/packages/apps/human-app/server/src/modules/oracle-discovery/model/oracle-discovery.model.ts +++ b/packages/apps/human-app/server/src/modules/oracle-discovery/model/oracle-discovery.model.ts @@ -5,22 +5,73 @@ import { IsArray, IsOptional } from 'class-validator'; import { Exclude, Transform } from 'class-transformer'; type DiscoveredOracleCreateProps = { + id: string; address: string; chainId: ChainId; + amountStaked: bigint; + amountLocked: bigint; + lockedUntilTimestamp: bigint; + amountWithdrawn: bigint; + amountSlashed: bigint; + reward: bigint; + amountJobsProcessed: bigint; role?: string; + fee?: bigint; + publicKey?: string; + webhookUrl?: string; + website?: string; url: string; jobTypes: string[]; registrationNeeded?: boolean; registrationInstructions?: string; + reputationNetworks?: string[]; + name?: string; + category?: string; }; export class DiscoveredOracle implements IOperator { + @ApiProperty({ description: 'Unique identifier of the oracle operator' }) + id: string; + @ApiProperty({ description: 'Address of the oracle operator' }) address: string; @ApiProperty({ description: 'Chain ID where the oracle is registered' }) chainId: ChainId; + @ApiProperty({ description: 'Amount staked by the operator' }) + amountStaked: bigint; + + @ApiProperty({ description: 'Amount currently locked by the operator' }) + amountLocked: bigint; + + @ApiProperty({ description: 'Timestamp until funds are locked' }) + lockedUntilTimestamp: bigint; + + @ApiProperty({ description: 'Total amount withdrawn by the operator' }) + amountWithdrawn: bigint; + + @ApiProperty({ description: 'Total amount slashed from the operator' }) + amountSlashed: bigint; + + @ApiProperty({ description: 'Total reward earned by the operator' }) + reward: bigint; + + @ApiProperty({ description: 'Number of jobs processed by the operator' }) + amountJobsProcessed: bigint; + + @ApiPropertyOptional({ description: 'Fee charged by the operator' }) + fee?: bigint; + + @ApiPropertyOptional({ description: 'Public key of the operator' }) + publicKey?: string; + + @ApiPropertyOptional({ description: 'Webhook URL of the operator' }) + webhookUrl?: string; + + @ApiPropertyOptional({ description: 'Website of the operator' }) + website?: string; + @ApiPropertyOptional({ description: 'URL of the oracle operator' }) url: string; @@ -41,28 +92,27 @@ export class DiscoveredOracle implements IOperator { }) registrationInstructions?: string; + @ApiPropertyOptional({ + type: [String], + description: 'Reputation networks the operator belongs to', + }) + reputationNetworks?: string[]; + + @ApiPropertyOptional({ description: 'Name of the operator' }) + name?: string; + + @ApiPropertyOptional({ description: 'Category of the operator' }) + category?: string; + @Exclude() retriesCount = 0; @Exclude() executionsToSkip = 0; - constructor({ - address, - chainId, - role, - url, - jobTypes, - registrationNeeded, - registrationInstructions, - }: DiscoveredOracleCreateProps) { - this.address = address; - this.chainId = chainId; - this.role = role; - this.url = url; - this.jobTypes = jobTypes; - this.registrationNeeded = registrationNeeded || false; - this.registrationInstructions = registrationInstructions; + constructor(props: DiscoveredOracleCreateProps) { + Object.assign(this, props); + this.registrationNeeded = props.registrationNeeded || false; } } @@ -73,6 +123,7 @@ export class GetOraclesQuery { @Transform(({ value }) => (Array.isArray(value) ? value : Array(value))) selected_job_types?: string[]; } + export class GetOraclesCommand { @AutoMap() @Transform(({ value }) => (Array.isArray(value) ? value : [value])) diff --git a/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.service.ts b/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.service.ts index 76cb3d51f2..3508b1ceea 100644 --- a/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.service.ts +++ b/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.service.ts @@ -29,7 +29,7 @@ export class OracleDiscoveryService { const selectedJobTypesSet = new Set(command.selectedJobTypes); return oracles.filter((oracle) => - oracle.jobTypes.some((jobType) => selectedJobTypesSet.has(jobType)), + oracle.jobTypes?.some((jobType) => selectedJobTypesSet.has(jobType)), ); } @@ -88,6 +88,7 @@ export class OracleDiscoveryService { ) { discoveredOracles.push( new DiscoveredOracle({ + id: exchangeOracle.id, address: exchangeOracle.address, role: exchangeOracle.role, url: exchangeOracle.url, @@ -95,6 +96,13 @@ export class OracleDiscoveryService { registrationNeeded: exchangeOracle.registrationNeeded, registrationInstructions: exchangeOracle.registrationInstructions, chainId, + amountStaked: exchangeOracle.amountStaked, + amountLocked: exchangeOracle.amountLocked, + amountWithdrawn: exchangeOracle.amountWithdrawn, + amountSlashed: exchangeOracle.amountSlashed, + amountJobsProcessed: exchangeOracle.amountJobsProcessed, + reward: exchangeOracle.reward, + lockedUntilTimestamp: exchangeOracle.lockedUntilTimestamp, }), ); } diff --git a/packages/apps/human-app/server/src/modules/oracle-discovery/spec/oracle-discovery.fixture.ts b/packages/apps/human-app/server/src/modules/oracle-discovery/spec/oracle-discovery.fixture.ts index ff121ffba7..3a621629a3 100644 --- a/packages/apps/human-app/server/src/modules/oracle-discovery/spec/oracle-discovery.fixture.ts +++ b/packages/apps/human-app/server/src/modules/oracle-discovery/spec/oracle-discovery.fixture.ts @@ -4,7 +4,8 @@ import { DiscoveredOracle, } from '../model/oracle-discovery.model'; -const response1: DiscoveredOracle = { +export const response1: DiscoveredOracle = { + id: '1', address: '0xd06eac24a0c47c776Ce6826A93162c4AfC029047', chainId: ChainId.POLYGON_AMOY, role: 'role1', @@ -14,8 +15,17 @@ const response1: DiscoveredOracle = { executionsToSkip: 0, registrationNeeded: true, registrationInstructions: 'https://instructions.com', + amountStaked: BigInt(0), + amountLocked: BigInt(0), + lockedUntilTimestamp: BigInt(0), + amountWithdrawn: BigInt(0), + amountSlashed: BigInt(0), + reward: BigInt(0), + amountJobsProcessed: BigInt(0), }; -const response2: DiscoveredOracle = { + +export const response2: DiscoveredOracle = { + id: '2', address: '0xd10c3402155c058D78e4D5fB5f50E125F06eb39d', chainId: ChainId.POLYGON_AMOY, role: 'role2', @@ -25,8 +35,17 @@ const response2: DiscoveredOracle = { executionsToSkip: 0, registrationNeeded: false, registrationInstructions: undefined, + amountStaked: BigInt(0), + amountLocked: BigInt(0), + lockedUntilTimestamp: BigInt(0), + amountWithdrawn: BigInt(0), + amountSlashed: BigInt(0), + reward: BigInt(0), + amountJobsProcessed: BigInt(0), }; -const response3: DiscoveredOracle = { + +export const response3: DiscoveredOracle = { + id: '3', address: '0xd83422155c058D78e4D5fB5f50E125F06eb39d', chainId: ChainId.POLYGON_AMOY, role: 'role3', @@ -36,8 +55,17 @@ const response3: DiscoveredOracle = { executionsToSkip: 0, registrationNeeded: false, registrationInstructions: undefined, + amountStaked: BigInt(0), + amountLocked: BigInt(0), + lockedUntilTimestamp: BigInt(0), + amountWithdrawn: BigInt(0), + amountSlashed: BigInt(0), + reward: BigInt(0), + amountJobsProcessed: BigInt(0), }; -const response4: DiscoveredOracle = { + +export const response4: DiscoveredOracle = { + id: '4', address: '0xd83422155c058D78e4D5fB5f50E125F06eb39d', chainId: ChainId.BSC_TESTNET, role: 'role3', @@ -47,6 +75,13 @@ const response4: DiscoveredOracle = { executionsToSkip: 0, registrationNeeded: false, registrationInstructions: undefined, + amountStaked: BigInt(0), + amountLocked: BigInt(0), + lockedUntilTimestamp: BigInt(0), + amountWithdrawn: BigInt(0), + amountSlashed: BigInt(0), + reward: BigInt(0), + amountJobsProcessed: BigInt(0), }; export function generateGetReputationNetworkOperatorsResponseByChainId( diff --git a/packages/apps/human-app/server/tsconfig.json b/packages/apps/human-app/server/tsconfig.json index 2e3f92b7aa..fa2f86f2a3 100644 --- a/packages/apps/human-app/server/tsconfig.json +++ b/packages/apps/human-app/server/tsconfig.json @@ -7,7 +7,7 @@ "experimentalDecorators": true, "allowSyntheticDefaultImports": true, "allowJs": true, - "target": "es2020", + "target": "es2023", "sourceMap": true, "outDir": "./dist", "baseUrl": "./", diff --git a/packages/apps/human-app/server/vercel.json b/packages/apps/human-app/server/vercel.json deleted file mode 100644 index 3e7126787b..0000000000 --- a/packages/apps/human-app/server/vercel.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 2, - "builds": [ - { - "src": "src/main.ts", - "use": "@vercel/node" - } - ], - "routes": [ - { - "src": "/(.*)", - "dest": "src/main.ts", - "headers": { - "Access-Control-Allow-Origin": "*", - "Access-Control-Allow-Methods": "*", - "Access-Control-Allow-Headers": "X-Requested-With,Content-Type,Accept" - } - } - ], - "ignoreCommand": "git diff HEAD^ HEAD --quiet ." -} diff --git a/packages/apps/job-launcher/client/Dockerfile b/packages/apps/job-launcher/client/Dockerfile index ece5e34e0b..6cc3402aec 100644 --- a/packages/apps/job-launcher/client/Dockerfile +++ b/packages/apps/job-launcher/client/Dockerfile @@ -1,5 +1,5 @@ # Using bullseye instead of slim because it needs Python and build tools for node-gyp -FROM node:18-bullseye +FROM node:22.14-bullseye ARG APP_PATH=packages/apps/job-launcher/client # Create app directory diff --git a/packages/apps/job-launcher/client/src/components/Jobs/Create/CreateJob.tsx b/packages/apps/job-launcher/client/src/components/Jobs/Create/CreateJob.tsx index 36b4732a7a..c609b8e3b1 100644 --- a/packages/apps/job-launcher/client/src/components/Jobs/Create/CreateJob.tsx +++ b/packages/apps/job-launcher/client/src/components/Jobs/Create/CreateJob.tsx @@ -13,6 +13,7 @@ import { HCaptchaJobRequestForm } from './HCaptchaJobRequestForm'; export const CreateJob = () => { const { payMethod, jobRequest, updateJobRequest } = useCreateJobPageUI(); const { chainId } = jobRequest; + console.log(jobRequest); const { chain } = useAccount(); const { switchChainAsync } = useSwitchChain(); diff --git a/packages/apps/job-launcher/client/src/components/Jobs/Create/CryptoPayForm.tsx b/packages/apps/job-launcher/client/src/components/Jobs/Create/CryptoPayForm.tsx index cca95b4e36..a08ffdbbee 100644 --- a/packages/apps/job-launcher/client/src/components/Jobs/Create/CryptoPayForm.tsx +++ b/packages/apps/job-launcher/client/src/components/Jobs/Create/CryptoPayForm.tsx @@ -25,7 +25,7 @@ import { usePublicClient, } from 'wagmi'; import { TokenSelect } from '../../../components/TokenSelect'; -import { CURRENCY } from '../../../constants/payment'; +import { NETWORK_TOKENS } from '../../../constants/chains'; import { useTokenRate } from '../../../hooks/useTokenRate'; import { useCreateJobPageUI } from '../../../providers/CreateJobPageUIProvider'; import * as jobService from '../../../services/job'; @@ -46,6 +46,7 @@ export const CryptoPayForm = ({ const { chain } = useAccount(); const { jobRequest, goToPrevStep } = useCreateJobPageUI(); const [tokenAddress, setTokenAddress] = useState(); + const [tokenSymbol, setTokenSymbol] = useState(); const [payWithAccountBalance, setPayWithAccountBalance] = useState(false); const [amount, setAmount] = useState(); const [isLoading, setIsLoading] = useState(false); @@ -103,7 +104,7 @@ export const CryptoPayForm = ({ }, [payWithAccountBalance, totalAmount, accountAmount]); const handlePay = async () => { - if (signer && tokenAddress && amount && jobRequest.chainId) { + if (signer && tokenAddress && amount && jobRequest.chainId && tokenSymbol) { setIsLoading(true); try { if (walletPayAmount > 0) { @@ -145,15 +146,17 @@ export const CryptoPayForm = ({ await jobService.createFortuneJob( chainId, fortuneRequest, + tokenSymbol, Number(amount), - CURRENCY.hmt, + tokenSymbol, ); } else if (jobType === JobType.CVAT && cvatRequest) { await jobService.createCvatJob( chainId, cvatRequest, + tokenSymbol, Number(amount), - CURRENCY.hmt, + tokenSymbol, ); } else if (jobType === JobType.HCAPTCHA && hCaptchaRequest) { await jobService.createHCaptchaJob(chainId, hCaptchaRequest); @@ -223,7 +226,15 @@ export const CryptoPayForm = ({ setTokenAddress(e.target.value as string)} + onChange={(e) => { + const symbol = e.target.value as string; + setTokenSymbol(symbol); + setTokenAddress( + NETWORK_TOKENS[ + jobRequest.chainId! as keyof typeof NETWORK_TOKENS + ]?.[symbol.toLowerCase()], + ); + }} /> Account Balance - {user?.balance?.amount?.toFixed(2) ?? '0'}{' '} + ~ {user?.balance?.amount?.toFixed(2) ?? '0'}{' '} {user?.balance?.currency?.toUpperCase() ?? 'USD'} @@ -265,7 +276,7 @@ export const CryptoPayForm = ({ > Fund Amount - {fundAmount?.toFixed(2)} USD + ~ {fundAmount?.toFixed(2)} USD (); useEffect(() => { const fetchJobLauncherData = async () => { @@ -181,6 +183,11 @@ export const FiatPayForm = ({ return; } + if (!tokenAddress) { + onError('Please select a token.'); + return; + } + onStart(); setIsLoading(true); @@ -215,11 +222,18 @@ export const FiatPayForm = ({ await createFortuneJob( chainId, fortuneRequest, - fundAmount, CURRENCY.usd, + fundAmount, + tokenAddress, ); } else if (jobType === JobType.CVAT && cvatRequest) { - await createCvatJob(chainId, cvatRequest, fundAmount, CURRENCY.usd); + await createCvatJob( + chainId, + cvatRequest, + CURRENCY.usd, + fundAmount, + tokenAddress, + ); } else if (jobType === JobType.HCAPTCHA && hCaptchaRequest) { await createHCaptchaJob(chainId, hCaptchaRequest); } @@ -321,6 +335,13 @@ export const FiatPayForm = ({ Add Payment Method )} + + setTokenAddress(e.target.value as string) + } + /> @@ -348,7 +369,7 @@ export const FiatPayForm = ({ Account Balance {user?.balance && ( - {user?.balance?.amount?.toFixed(2)} USD + ~ {user?.balance?.amount?.toFixed(2)} USD )} @@ -427,7 +448,8 @@ export const FiatPayForm = ({ disabled={ !amount || (!payWithAccountBalance && !selectedCard) || - hasError + hasError || + !tokenAddress } > Pay now diff --git a/packages/apps/job-launcher/client/src/components/TokenSelect/index.tsx b/packages/apps/job-launcher/client/src/components/TokenSelect/index.tsx index 111c515b56..80bfa2bfb6 100644 --- a/packages/apps/job-launcher/client/src/components/TokenSelect/index.tsx +++ b/packages/apps/job-launcher/client/src/components/TokenSelect/index.tsx @@ -28,11 +28,11 @@ export const TokenSelect: FC = (props) => { return ( - Token + Funding token