From 22809c3fe31570b3e60e5bd97489bdecdf0cc7ab Mon Sep 17 00:00:00 2001 From: KirillKirill Date: Fri, 1 Aug 2025 15:32:38 +0300 Subject: [PATCH 01/14] [Dashboard] fix: HMT balance and token amount (#3489) --- .../model/addressDetailsSchema.ts | 39 +++++-------------- .../searchResults/ui/EscrowAddress.tsx | 18 ++------- .../features/searchResults/ui/HmtBalance.tsx | 6 +-- .../features/searchResults/ui/StakeInfo.tsx | 12 +++--- .../features/searchResults/ui/TokenAmount.tsx | 9 +---- 5 files changed, 22 insertions(+), 62 deletions(-) diff --git a/packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts b/packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts index e12e5844ee..8c035e1a3f 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts +++ b/packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts @@ -3,33 +3,15 @@ import { z } from 'zod'; import { reputationSchema } from '@/shared/model/reputationSchema'; -const transformOptionalTokenAmount = ( - value: string | undefined | null, - ctx: z.RefinementCtx -) => { - if (value === undefined || value === null) return value; - - const valueAsNumber = Number(value); - - if (Number.isNaN(valueAsNumber)) { - ctx.addIssue({ - path: ['amountStaked'], - code: z.ZodIssueCode.custom, - }); - } - - return valueAsNumber / 10 ** 18; -}; - const walletSchema = z.object({ chainId: z.number(), address: z.string(), - balance: z.string().transform(transformOptionalTokenAmount), - amountStaked: z.string().transform(transformOptionalTokenAmount), - amountLocked: z.string().transform(transformOptionalTokenAmount), - amountWithdrawable: z.string().transform(transformOptionalTokenAmount), + balance: z.string(), + amountStaked: z.string(), + amountLocked: z.string(), + amountWithdrawable: z.string(), reputation: reputationSchema, - totalHMTAmountReceived: z.string().transform(transformOptionalTokenAmount), + totalHMTAmountReceived: z.string(), payoutCount: z.number().or(z.string()), }); @@ -59,7 +41,7 @@ export type AddressDetailsEscrow = z.infer; const operatorSchema = z.object({ chainId: z.number(), address: z.string(), - balance: z.string().transform(transformOptionalTokenAmount), + balance: z.string(), role: z .enum([ Role.JobLauncher, @@ -68,12 +50,9 @@ const operatorSchema = z.object({ Role.ReputationOracle, ]) .nullable(), - amountStaked: z.string().optional().transform(transformOptionalTokenAmount), - amountLocked: z.string().optional().transform(transformOptionalTokenAmount), - amountWithdrawable: z - .string() - .optional() - .transform(transformOptionalTokenAmount), + amountStaked: z.string().optional(), + amountLocked: z.string().optional(), + amountWithdrawable: z.string().optional(), lockedUntilTimestamp: z.string().optional(), reputation: reputationSchema, fee: z.number(), diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx index 8f8318f455..889f0fc119 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/EscrowAddress.tsx @@ -41,11 +41,7 @@ const EscrowAddress: FC = ({ data }) => { {isHmt ? ( ) : ( - + )} ) : null} @@ -56,18 +52,10 @@ const EscrowAddress: FC = ({ data }) => { {factoryAddress} - + - + diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx index fab1fbc99c..433e0fff20 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/HmtBalance.tsx @@ -22,13 +22,11 @@ const HmtBalance: FC = ({ balance }) => { return ...; } - const _balance = - Number(balance) < 1 ? Number(balance) * 1e18 : Number(balance); - const balanceInDollars = balance ? (_balance * data).toFixed(2) : 0; + const balanceInDollars = balance ? (+balance * data).toFixed(2) : 0; return ( - + {`($${balanceInDollars})`} diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx index 60d7023dbb..b8b7c08ebc 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/StakeInfo.tsx @@ -8,9 +8,9 @@ import SectionWrapper from '@/shared/ui/SectionWrapper'; import TokenAmount from './TokenAmount'; type Props = { - amountStaked?: number | null; - amountLocked?: number | null; - amountWithdrawable?: number | null; + amountStaked?: string | number | null; + amountLocked?: string | number | null; + amountWithdrawable?: string | number | null; }; const StakeInfo: FC = ({ @@ -26,7 +26,7 @@ const StakeInfo: FC = ({ Stake Info - {Number.isFinite(amountStaked) && ( + {Number.isFinite(Number(amountStaked)) && ( Staked Tokens @@ -34,7 +34,7 @@ const StakeInfo: FC = ({ )} - {Number.isFinite(amountLocked) && ( + {Number.isFinite(Number(amountLocked)) && ( Locked Tokens @@ -42,7 +42,7 @@ const StakeInfo: FC = ({ )} - {Number.isFinite(amountWithdrawable) && ( + {Number.isFinite(Number(amountWithdrawable)) && ( Withdrawable Tokens diff --git a/packages/apps/dashboard/client/src/features/searchResults/ui/TokenAmount.tsx b/packages/apps/dashboard/client/src/features/searchResults/ui/TokenAmount.tsx index ae097a4229..5a92ac4a32 100644 --- a/packages/apps/dashboard/client/src/features/searchResults/ui/TokenAmount.tsx +++ b/packages/apps/dashboard/client/src/features/searchResults/ui/TokenAmount.tsx @@ -9,21 +9,16 @@ import FormattedNumber from '@/shared/ui/FormattedNumber'; type Props = { amount: number | string | null | undefined; tokenSymbol?: string | null | undefined; - alreadyParsed?: boolean; }; -const TokenAmount: FC = ({ - amount, - tokenSymbol = 'HMT', - alreadyParsed = false, -}) => { +const TokenAmount: FC = ({ amount, tokenSymbol = 'HMT' }) => { const isMobile = useIsMobile(); return ( From f800a508f10d53c535c2a21ffc551529d6889141 Mon Sep 17 00:00:00 2001 From: Siarhei Date: Fri, 1 Aug 2025 16:33:58 +0300 Subject: [PATCH 02/14] [CVAT] Added aurora testnet support (#3488) --- .../cvat/exchange-oracle/src/.env.template | 6 +++++ .../cvat/exchange-oracle/src/chain/web3.py | 12 +++++++++ .../cvat/exchange-oracle/src/core/config.py | 8 ++++++ .../cvat/exchange-oracle/src/core/types.py | 1 + .../exchange-oracle/src/endpoints/__init__.py | 2 +- .../tests/api/test_webhook_api.py | 2 +- .../tests/integration/chain/test_web3.py | 25 +++++++++++++++++++ .../cvat/recording-oracle/src/.env.template | 6 +++++ .../cvat/recording-oracle/src/chain/web3.py | 12 +++++++++ .../cvat/recording-oracle/src/core/config.py | 8 ++++++ .../cvat/recording-oracle/src/core/types.py | 1 + .../src/endpoints/__init__.py | 2 +- .../tests/integration/chain/test_web3.py | 24 ++++++++++++++++++ 13 files changed, 106 insertions(+), 3 deletions(-) diff --git a/packages/examples/cvat/exchange-oracle/src/.env.template b/packages/examples/cvat/exchange-oracle/src/.env.template index 88a546cff2..3d2ce69e73 100644 --- a/packages/examples/cvat/exchange-oracle/src/.env.template +++ b/packages/examples/cvat/exchange-oracle/src/.env.template @@ -35,6 +35,12 @@ POLYGON_AMOY_RPC_API_URL= POLYGON_AMOY_PRIVATE_KEY= POLYGON_AMOY_ADDR= +# Aurora Testnet Config + +AURORA_TESTNET_RPC_API_URL= +AURORA_TESTNET_PRIVATE_KEY= +AURORA_TESTNET_ADDR= + # Cron Config PROCESS_JOB_LAUNCHER_WEBHOOKS_INT= diff --git a/packages/examples/cvat/exchange-oracle/src/chain/web3.py b/packages/examples/cvat/exchange-oracle/src/chain/web3.py index db52a6c01b..b1783544d5 100644 --- a/packages/examples/cvat/exchange-oracle/src/chain/web3.py +++ b/packages/examples/cvat/exchange-oracle/src/chain/web3.py @@ -32,6 +32,16 @@ def get_web3(chain_id: Networks): ) w3.eth.default_account = gas_payer.address return w3 + case Config.aurora_testnet.chain_id: + w3 = Web3(HTTPProvider(Config.aurora_testnet.rpc_api)) + gas_payer = w3.eth.account.from_key(Config.aurora_testnet.private_key) + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(Config.aurora_testnet.private_key), + "SignAndSendRawMiddlewareBuilder", + layer=0, + ) + w3.eth.default_account = gas_payer.address + return w3 case Config.localhost.chain_id: w3 = Web3(HTTPProvider(Config.localhost.rpc_api)) gas_payer = w3.eth.account.from_key(Config.localhost.private_key) @@ -58,6 +68,8 @@ def sign_message(chain_id: Networks, message) -> str: private_key = Config.polygon_mainnet.private_key case Config.polygon_amoy.chain_id: private_key = Config.polygon_amoy.private_key + case Config.aurora_testnet.chain_id: + private_key = Config.aurora_testnet.private_key case Config.localhost.chain_id: private_key = Config.localhost.private_key case _: diff --git a/packages/examples/cvat/exchange-oracle/src/core/config.py b/packages/examples/cvat/exchange-oracle/src/core/config.py index 245380cc58..3b3dbad184 100644 --- a/packages/examples/cvat/exchange-oracle/src/core/config.py +++ b/packages/examples/cvat/exchange-oracle/src/core/config.py @@ -96,6 +96,13 @@ class PolygonAmoyConfig(_NetworkConfig): addr = getenv("POLYGON_AMOY_ADDR") +class AuroraTestnetConfig(_NetworkConfig): + chain_id = 1313161555 + rpc_api = getenv("AURORA_TESTNET_RPC_API_URL") + private_key = getenv("AURORA_TESTNET_PRIVATE_KEY") + addr = getenv("AURORA_TESTNET_ADDR") + + class LocalhostConfig(_NetworkConfig): chain_id = 1338 rpc_api = getenv("LOCALHOST_RPC_API_URL", "http://blockchain-node:8545") @@ -329,6 +336,7 @@ class Config: polygon_mainnet = PolygonMainnetConfig polygon_amoy = PolygonAmoyConfig + aurora_testnet = AuroraTestnetConfig localhost = LocalhostConfig postgres_config = PostgresConfig diff --git a/packages/examples/cvat/exchange-oracle/src/core/types.py b/packages/examples/cvat/exchange-oracle/src/core/types.py index 20a04c0b59..5a27844fb4 100644 --- a/packages/examples/cvat/exchange-oracle/src/core/types.py +++ b/packages/examples/cvat/exchange-oracle/src/core/types.py @@ -7,6 +7,7 @@ class Networks(int, Enum, metaclass=BetterEnumMeta): polygon_mainnet = Config.polygon_mainnet.chain_id polygon_amoy = Config.polygon_amoy.chain_id + aurora_testnet = Config.aurora_testnet.chain_id localhost = Config.localhost.chain_id diff --git a/packages/examples/cvat/exchange-oracle/src/endpoints/__init__.py b/packages/examples/cvat/exchange-oracle/src/endpoints/__init__.py index 9943fea79f..93f0a8becf 100644 --- a/packages/examples/cvat/exchange-oracle/src/endpoints/__init__.py +++ b/packages/examples/cvat/exchange-oracle/src/endpoints/__init__.py @@ -16,7 +16,7 @@ @greet_router.get("/", description="Endpoint describing the API", response_model=MetaResponse) def meta_route() -> MetaResponse: - networks = [Config.polygon_mainnet, Config.polygon_amoy] + networks = [Config.polygon_mainnet, Config.polygon_amoy, Config.aurora_testnet] networks_info = [ { diff --git a/packages/examples/cvat/exchange-oracle/tests/api/test_webhook_api.py b/packages/examples/cvat/exchange-oracle/tests/api/test_webhook_api.py index ad18f1e126..a2602c483b 100644 --- a/packages/examples/cvat/exchange-oracle/tests/api/test_webhook_api.py +++ b/packages/examples/cvat/exchange-oracle/tests/api/test_webhook_api.py @@ -116,7 +116,7 @@ def test_incoming_webhook_400_invalid_chain_id(client: TestClient) -> None: "errors": [ { "field": "chain_id", - "message": "Input should be 137, 80002 or 1338", + "message": "Input should be 137, 80002, 1313161555 or 1338", } ] } diff --git a/packages/examples/cvat/exchange-oracle/tests/integration/chain/test_web3.py b/packages/examples/cvat/exchange-oracle/tests/integration/chain/test_web3.py index 13b04fa428..d313fd5fed 100644 --- a/packages/examples/cvat/exchange-oracle/tests/integration/chain/test_web3.py +++ b/packages/examples/cvat/exchange-oracle/tests/integration/chain/test_web3.py @@ -50,6 +50,18 @@ class PolygonAmoyConfig: assert w3.eth.default_account == DEFAULT_GAS_PAYER assert w3.manager._provider.endpoint_uri == PolygonAmoyConfig.rpc_api + def test_get_web3_aurora_testnet(self): + class AuroraTestnetConfig: + chain_id = 1313161555 + rpc_api = " https://testnet.aurora.dev" + private_key = DEFAULT_GAS_PAYER_PRIV + + with patch("src.chain.web3.Config.aurora_testnet", AuroraTestnetConfig): + w3 = get_web3(ChainId.AURORA_TESTNET.value) + assert isinstance(w3, Web3) + assert w3.eth.default_account == DEFAULT_GAS_PAYER + assert w3.manager._provider.endpoint_uri == AuroraTestnetConfig.rpc_api + def test_get_web3_localhost(self): w3 = get_web3(ChainId.LOCALHOST.value) assert isinstance(w3, Web3) @@ -82,6 +94,19 @@ def test_sign_message_amoy(self): assert signature == SIGNATURE assert serialized_message == json.dumps("message") + def test_sign_message_aurora_tesnet(self): + with patch("src.chain.web3.get_web3") as mock_function: + with patch( + "src.chain.web3.Config.aurora_testnet.private_key", + DEFAULT_GAS_PAYER_PRIV, + ): + mock_function.return_value = self.w3 + signature, serialized_message = sign_message( + ChainId.AURORA_TESTNET.value, "message" + ) + assert signature == SIGNATURE + assert serialized_message == json.dumps("message") + def test_sign_message_invalid_chain_id(self): with pytest.raises(ValueError, match="1234 is not in available list of networks."): sign_message(1234, "message") diff --git a/packages/examples/cvat/recording-oracle/src/.env.template b/packages/examples/cvat/recording-oracle/src/.env.template index d63b8d41e3..988f1ab35e 100644 --- a/packages/examples/cvat/recording-oracle/src/.env.template +++ b/packages/examples/cvat/recording-oracle/src/.env.template @@ -26,6 +26,12 @@ POLYGON_AMOY_RPC_API_URL= POLYGON_AMOY_PRIVATE_KEY= POLYGON_AMOY_ADDR= +# Aurora Testnet Config + +AURORA_TESTNET_RPC_API_URL= +AURORA_TESTNET_PRIVATE_KEY= +AURORA_TESTNET_ADDR= + # Cron jobs PROCESS_EXCHANGE_ORACLE_WEBHOOKS_INT= diff --git a/packages/examples/cvat/recording-oracle/src/chain/web3.py b/packages/examples/cvat/recording-oracle/src/chain/web3.py index c2ad58d5f1..b1cd682f49 100644 --- a/packages/examples/cvat/recording-oracle/src/chain/web3.py +++ b/packages/examples/cvat/recording-oracle/src/chain/web3.py @@ -32,6 +32,16 @@ def get_web3(chain_id: Networks): ) w3.eth.default_account = gas_payer.address return w3 + case Config.aurora_testnet.chain_id: + w3 = Web3(HTTPProvider(Config.aurora_testnet.rpc_api)) + gas_payer = w3.eth.account.from_key(Config.aurora_testnet.private_key) + w3.middleware_onion.inject( + SignAndSendRawMiddlewareBuilder.build(Config.aurora_testnet.private_key), + "SignAndSendRawMiddlewareBuilder", + layer=0, + ) + w3.eth.default_account = gas_payer.address + return w3 case Config.localhost.chain_id: w3 = Web3(HTTPProvider(Config.localhost.rpc_api)) gas_payer = w3.eth.account.from_key(Config.localhost.private_key) @@ -58,6 +68,8 @@ def sign_message(chain_id: Networks, message) -> tuple: private_key = Config.polygon_mainnet.private_key case Config.polygon_amoy.chain_id: private_key = Config.polygon_amoy.private_key + case Config.aurora_testnet.chain_id: + private_key = Config.aurora_testnet.private_key case Config.localhost.chain_id: private_key = Config.localhost.private_key case _: diff --git a/packages/examples/cvat/recording-oracle/src/core/config.py b/packages/examples/cvat/recording-oracle/src/core/config.py index 477046d0bf..a18c9f722e 100644 --- a/packages/examples/cvat/recording-oracle/src/core/config.py +++ b/packages/examples/cvat/recording-oracle/src/core/config.py @@ -71,6 +71,13 @@ class PolygonAmoyConfig(_NetworkConfig): addr = getenv("POLYGON_AMOY_ADDR") +class AuroraTestnetConfig(_NetworkConfig): + chain_id = 1313161555 + rpc_api = getenv("AURORA_TESTNET_RPC_API_URL") + private_key = getenv("AURORA_TESTNET_PRIVATE_KEY") + addr = getenv("AURORA_TESTNET_ADDR") + + class LocalhostConfig(_NetworkConfig): chain_id = 1338 rpc_api = getenv("LOCALHOST_RPC_API_URL", "http://blockchain-node:8545") @@ -254,6 +261,7 @@ class Config: polygon_mainnet = PolygonMainnetConfig polygon_amoy = PolygonAmoyConfig + aurora_testnet = AuroraTestnetConfig localhost = LocalhostConfig postgres_config = Postgres diff --git a/packages/examples/cvat/recording-oracle/src/core/types.py b/packages/examples/cvat/recording-oracle/src/core/types.py index 6bb84c68cc..655f352380 100644 --- a/packages/examples/cvat/recording-oracle/src/core/types.py +++ b/packages/examples/cvat/recording-oracle/src/core/types.py @@ -7,6 +7,7 @@ class Networks(int, Enum): polygon_mainnet = Config.polygon_mainnet.chain_id polygon_amoy = Config.polygon_amoy.chain_id + aurora_testnet = Config.aurora_testnet.chain_id localhost = Config.localhost.chain_id diff --git a/packages/examples/cvat/recording-oracle/src/endpoints/__init__.py b/packages/examples/cvat/recording-oracle/src/endpoints/__init__.py index 4a21381846..114469a3f0 100644 --- a/packages/examples/cvat/recording-oracle/src/endpoints/__init__.py +++ b/packages/examples/cvat/recording-oracle/src/endpoints/__init__.py @@ -11,7 +11,7 @@ @greet_router.get("/", description="Endpoint describing the API", response_model=MetaResponse) def meta_route() -> MetaResponse: - networks = [Config.polygon_mainnet, Config.polygon_amoy] + networks = [Config.polygon_mainnet, Config.polygon_amoy, Config.aurora_testnet] networks_info = [ { diff --git a/packages/examples/cvat/recording-oracle/tests/integration/chain/test_web3.py b/packages/examples/cvat/recording-oracle/tests/integration/chain/test_web3.py index 1638bcdafb..fd4a291615 100644 --- a/packages/examples/cvat/recording-oracle/tests/integration/chain/test_web3.py +++ b/packages/examples/cvat/recording-oracle/tests/integration/chain/test_web3.py @@ -49,6 +49,18 @@ class PolygonAmoyConfig: assert w3.eth.default_account == DEFAULT_GAS_PAYER assert w3.manager._provider.endpoint_uri == PolygonAmoyConfig.rpc_api + def test_get_web3_aurora_testnet(self): + class AuroraTestnetConfig: + chain_id = 1313161555 + rpc_api = " https://testnet.aurora.dev" + private_key = DEFAULT_GAS_PAYER_PRIV + + with patch("src.chain.web3.Config.aurora_testnet", AuroraTestnetConfig): + w3 = get_web3(ChainId.AURORA_TESTNET.value) + assert isinstance(w3, Web3) + assert w3.eth.default_account == DEFAULT_GAS_PAYER + assert w3.manager._provider.endpoint_uri == AuroraTestnetConfig.rpc_api + def test_get_web3_localhost(self): w3 = get_web3(ChainId.LOCALHOST.value) assert isinstance(w3, Web3) @@ -83,6 +95,18 @@ def test_sign_message_amoy(self): signed_message, _ = sign_message(ChainId.POLYGON_AMOY.value, "message") assert signed_message == SIGNATURE + def test_sign_message_aurora_testnet(self): + with ( + patch("src.chain.web3.get_web3") as mock_function, + patch( + "src.chain.web3.Config.aurora_testnet.private_key", + DEFAULT_GAS_PAYER_PRIV, + ), + ): + mock_function.return_value = self.w3 + signed_message, _ = sign_message(ChainId.AURORA_TESTNET.value, "message") + assert signed_message == SIGNATURE + def test_sign_message_invalid_chain_id(self): with pytest.raises(ValueError, match="1234 is not in available list of networks."): sign_message(1234, "message") From eddd504686750a4d17d35e965d42527c01eecc21 Mon Sep 17 00:00:00 2001 From: Dmitry Nechay Date: Tue, 5 Aug 2025 12:41:24 +0300 Subject: [PATCH 03/14] [HUMAN App] feat: avoid same oracle displaying in oracle discovery (#3491) --- .../src/modules/worker/services/oracles.service.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/apps/human-app/frontend/src/modules/worker/services/oracles.service.ts b/packages/apps/human-app/frontend/src/modules/worker/services/oracles.service.ts index 807a76950e..b77dec9263 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/services/oracles.service.ts +++ b/packages/apps/human-app/frontend/src/modules/worker/services/oracles.service.ts @@ -72,6 +72,16 @@ async function getOracles(selectedJobTypes: string[]) { } } + const oracleAddresses = new Set(); + oracles = oracles.filter(({ address: oracleAddress }) => { + if (oracleAddresses.has(oracleAddress)) { + return false; + } + + oracleAddresses.add(oracleAddress); + return true; + }); + return oracles; } catch (error) { if (error instanceof ApiClientError) { From 8d41eee63a47f92a6850f017c7831243dc04899c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 11:51:32 +0200 Subject: [PATCH 04/14] chore(deps-dev): bump hardhat from 2.24.0 to 2.26.0 (#3470) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/apps/faucet/server/package.json | 2 +- packages/core/package.json | 2 +- yarn.lock | 135 ++++++++++++----------- 3 files changed, 73 insertions(+), 66 deletions(-) diff --git a/packages/apps/faucet/server/package.json b/packages/apps/faucet/server/package.json index 3f582ac06f..869d283198 100644 --- a/packages/apps/faucet/server/package.json +++ b/packages/apps/faucet/server/package.json @@ -30,7 +30,7 @@ "@types/node": "^22.15.16", "concurrently": "^9.1.2", "eslint": "^8.55.0", - "hardhat": "^2.24.0", + "hardhat": "^2.26.0", "jest": "^29.7.0", "ts-node": "^10.9.2", "typescript": "^5.8.3" diff --git a/packages/core/package.json b/packages/core/package.json index 3523a8e5a4..54041e1310 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -71,7 +71,7 @@ "concurrently": "^9.1.2", "eslint": "^8.55.0", "ethers": "~6.13.5", - "hardhat": "^2.22.18", + "hardhat": "^2.26.0", "hardhat-abi-exporter": "^2.10.1", "hardhat-contract-sizer": "^2.6.1", "hardhat-dependency-compiler": "^1.2.1", diff --git a/yarn.lock b/yarn.lock index ebd1f41397..e7dc3a97a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3926,7 +3926,7 @@ __metadata: concurrently: "npm:^9.1.2" eslint: "npm:^8.55.0" ethers: "npm:~6.13.5" - hardhat: "npm:^2.22.18" + hardhat: "npm:^2.26.0" hardhat-abi-exporter: "npm:^2.10.1" hardhat-contract-sizer: "npm:^2.6.1" hardhat-dependency-compiler: "npm:^1.2.1" @@ -4084,7 +4084,7 @@ __metadata: eslint: "npm:^8.55.0" express: "npm:^4.21.0" express-rate-limit: "npm:^7.3.0" - hardhat: "npm:^2.24.0" + hardhat: "npm:^2.26.0" jest: "npm:^29.7.0" node-cache: "npm:^5.1.2" ts-node: "npm:^10.9.2" @@ -6816,6 +6816,15 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:~1.9.2": + version: 1.9.4 + resolution: "@noble/curves@npm:1.9.4" + dependencies: + "@noble/hashes": "npm:1.8.0" + checksum: 10c0/c5ac42bf0c4ac822ee7c107f7b5647140a4209bce6929cdf21a38bc575be8aa91c130c4d4bea5a8a3100c53728fc0c6757382f005779cd14b10ea9a00f1a4592 + languageName: node + linkType: hard + "@noble/hashes@npm:1.2.0, @noble/hashes@npm:~1.2.0": version: 1.2.0 resolution: "@noble/hashes@npm:1.2.0" @@ -6865,6 +6874,13 @@ __metadata: languageName: node linkType: hard +"@noble/hashes@npm:2.0.0-beta.1": + version: 2.0.0-beta.1 + resolution: "@noble/hashes@npm:2.0.0-beta.1" + checksum: 10c0/dde464e841efb008e40ec2bc8431fec4de11c4778b0491c03247aa05c4e900a8b5212c9c90043b836f47d3d9ff48c22419513ed8219fed380cdaa17e1fc4fddc + languageName: node + linkType: hard + "@noble/secp256k1@npm:1.7.1": version: 1.7.1 resolution: "@noble/secp256k1@npm:1.7.1" @@ -6913,67 +6929,67 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/edr-darwin-arm64@npm:0.11.0": - version: 0.11.0 - resolution: "@nomicfoundation/edr-darwin-arm64@npm:0.11.0" - checksum: 10c0/bf4abf4a4c84b4cbe6077dc05421e72aeadde719b4a33825c994126c8b3c5bb2a6296941ab18ad9f54945becf9dee692a8cbb77e7448be246dfcdde19ac2b967 +"@nomicfoundation/edr-darwin-arm64@npm:0.11.3": + version: 0.11.3 + resolution: "@nomicfoundation/edr-darwin-arm64@npm:0.11.3" + checksum: 10c0/f5923e05a9409a9e3956b95db7e6bbd4345c3cd8de617406a308e257bd4706d59d6f6f8d6ec774d6473d956634ba5c322ec903b66830844683809eb102ec510e languageName: node linkType: hard -"@nomicfoundation/edr-darwin-x64@npm:0.11.0": - version: 0.11.0 - resolution: "@nomicfoundation/edr-darwin-x64@npm:0.11.0" - checksum: 10c0/aff56bb9c247f7fc435e208dc7bc17bea8f7f27e8d63797dadd2565db6641c684f16d77685375f7d5194238da648415085b9a71243e5e4e7743c37edff2e64c5 +"@nomicfoundation/edr-darwin-x64@npm:0.11.3": + version: 0.11.3 + resolution: "@nomicfoundation/edr-darwin-x64@npm:0.11.3" + checksum: 10c0/f529d2ef57a54bb34fb7888b545f19675624086bd93383e8d91c8dee1555532d2d28e72363b6a3b84e3920911bd550333898636873922cb5899c74b496f847aa languageName: node linkType: hard -"@nomicfoundation/edr-linux-arm64-gnu@npm:0.11.0": - version: 0.11.0 - resolution: "@nomicfoundation/edr-linux-arm64-gnu@npm:0.11.0" - checksum: 10c0/454fe2c7a1be6add79527b3372671483e5012949bc022a0ddf63773d79b5c8920375b25385594d05f26d553b10ca273df4c4084c30515788a2ab6aa25440aa0c +"@nomicfoundation/edr-linux-arm64-gnu@npm:0.11.3": + version: 0.11.3 + resolution: "@nomicfoundation/edr-linux-arm64-gnu@npm:0.11.3" + checksum: 10c0/4a8b4674d2e975434a1eab607f77947aa7dd501896ddb0b24f6f09e497776d197617dcac36076f4e274ac55ce0f1c85de228dff432d470459df6aa35b97176f2 languageName: node linkType: hard -"@nomicfoundation/edr-linux-arm64-musl@npm:0.11.0": - version: 0.11.0 - resolution: "@nomicfoundation/edr-linux-arm64-musl@npm:0.11.0" - checksum: 10c0/8737fb029d7572ae09ca2c02ec5bd4f15d541d361e8adbacb8dd26448b1a6e1e0f2af3883aad983309217d9a0104488c15e6427563bad3d754f25427571b6077 +"@nomicfoundation/edr-linux-arm64-musl@npm:0.11.3": + version: 0.11.3 + resolution: "@nomicfoundation/edr-linux-arm64-musl@npm:0.11.3" + checksum: 10c0/e0bf840cf209db1a8c7bb6dcd35af5c751921c2125ccf11457dbf5f66ef3c306d060933e5cbe9469ac8b440b8fcc19fa13fae8e919b5a03087c70d688cce461f languageName: node linkType: hard -"@nomicfoundation/edr-linux-x64-gnu@npm:0.11.0": - version: 0.11.0 - resolution: "@nomicfoundation/edr-linux-x64-gnu@npm:0.11.0" - checksum: 10c0/21902281cd923bff6e0057cc79e81fde68376caf4db6b0798ccefd6eb2583899ee23f0ccd24c90a8180c6d8426fbf7876bf5d3e61546bd3dfc586a5b69f32f9c +"@nomicfoundation/edr-linux-x64-gnu@npm:0.11.3": + version: 0.11.3 + resolution: "@nomicfoundation/edr-linux-x64-gnu@npm:0.11.3" + checksum: 10c0/c7617c11029223998cf177d49fb4979b7dcfcc9369cadaa82d2f9fb58c7f8091a33c4c46416e3fb71d9ff2276075d69fd076917841e3912466896ba1ca45cb94 languageName: node linkType: hard -"@nomicfoundation/edr-linux-x64-musl@npm:0.11.0": - version: 0.11.0 - resolution: "@nomicfoundation/edr-linux-x64-musl@npm:0.11.0" - checksum: 10c0/0cc2cb5756228946734811e9aa3abc291e96ece5357895ff2a004888aef8bc6c85d53266cf2a3b2ae0ff08e81516676a7117fe9bf4478156b0b957cea10a68f1 +"@nomicfoundation/edr-linux-x64-musl@npm:0.11.3": + version: 0.11.3 + resolution: "@nomicfoundation/edr-linux-x64-musl@npm:0.11.3" + checksum: 10c0/ef1623581a1d7072c88c0dc342480bed1253131d8775827ae8dddda26b2ecc4f4def3d8ec83ee60ac33e70539a58ed0b7a200040a06f31f9b3eccc3003c3af8d languageName: node linkType: hard -"@nomicfoundation/edr-win32-x64-msvc@npm:0.11.0": - version: 0.11.0 - resolution: "@nomicfoundation/edr-win32-x64-msvc@npm:0.11.0" - checksum: 10c0/716cdb10470a4cfab1f3d9cfed85adea457914c18121e6b30e4c8ae3a3c1d5cd291650feffceb09e4794cf7b6f7f31897710cd836235ea9c9e4159a14405335d +"@nomicfoundation/edr-win32-x64-msvc@npm:0.11.3": + version: 0.11.3 + resolution: "@nomicfoundation/edr-win32-x64-msvc@npm:0.11.3" + checksum: 10c0/0b3975a22fe31cea5799a3b4020acdf01627508e5f617545ad9f5f5f6739b1a954e1cd397e6d00a56eddd2c88b24d290b8e76f871eab7a847d97ee740e825249 languageName: node linkType: hard -"@nomicfoundation/edr@npm:^0.11.0": - version: 0.11.0 - resolution: "@nomicfoundation/edr@npm:0.11.0" +"@nomicfoundation/edr@npm:^0.11.3": + version: 0.11.3 + resolution: "@nomicfoundation/edr@npm:0.11.3" dependencies: - "@nomicfoundation/edr-darwin-arm64": "npm:0.11.0" - "@nomicfoundation/edr-darwin-x64": "npm:0.11.0" - "@nomicfoundation/edr-linux-arm64-gnu": "npm:0.11.0" - "@nomicfoundation/edr-linux-arm64-musl": "npm:0.11.0" - "@nomicfoundation/edr-linux-x64-gnu": "npm:0.11.0" - "@nomicfoundation/edr-linux-x64-musl": "npm:0.11.0" - "@nomicfoundation/edr-win32-x64-msvc": "npm:0.11.0" - checksum: 10c0/446203e8ebc98742d913ad9d1f89774fac4f1fb69f04c170787d7ff9fcfe06eeb1a9e1e0649980fca6d3e5c36099e784fc5a6b4380da8e59dd016cb6575adb63 + "@nomicfoundation/edr-darwin-arm64": "npm:0.11.3" + "@nomicfoundation/edr-darwin-x64": "npm:0.11.3" + "@nomicfoundation/edr-linux-arm64-gnu": "npm:0.11.3" + "@nomicfoundation/edr-linux-arm64-musl": "npm:0.11.3" + "@nomicfoundation/edr-linux-x64-gnu": "npm:0.11.3" + "@nomicfoundation/edr-linux-x64-musl": "npm:0.11.3" + "@nomicfoundation/edr-win32-x64-msvc": "npm:0.11.3" + checksum: 10c0/48280ca1ae6913e92a34abf8f70656bc09c217094326b5e81e9d299924a24b7041240109d0f024a3c33706f542e0668f7e320a2eb02657f9bf7bbf29cd7b8f5d languageName: node linkType: hard @@ -10396,13 +10412,6 @@ __metadata: languageName: node linkType: hard -"@types/lru-cache@npm:^5.1.0": - version: 5.1.1 - resolution: "@types/lru-cache@npm:5.1.1" - checksum: 10c0/1f17ec9b202c01a89337cc5528198a690be6b61a6688242125fbfb7fa17770e453e00e4685021abf5ae605860ca0722209faac5c254b780d0104730bb0b9e354 - languageName: node - linkType: hard - "@types/luxon@npm:~3.4.0": version: 3.4.2 resolution: "@types/luxon@npm:3.4.2" @@ -19983,17 +19992,15 @@ __metadata: languageName: node linkType: hard -"hardhat@npm:^2.22.18, hardhat@npm:^2.24.0": - version: 2.24.0 - resolution: "hardhat@npm:2.24.0" +"hardhat@npm:^2.26.0": + version: 2.26.0 + resolution: "hardhat@npm:2.26.0" dependencies: "@ethereumjs/util": "npm:^9.1.0" "@ethersproject/abi": "npm:^5.1.2" - "@nomicfoundation/edr": "npm:^0.11.0" + "@nomicfoundation/edr": "npm:^0.11.3" "@nomicfoundation/solidity-analyzer": "npm:^0.1.0" "@sentry/node": "npm:^5.18.1" - "@types/bn.js": "npm:^5.1.0" - "@types/lru-cache": "npm:^5.1.0" adm-zip: "npm:^0.4.16" aggregate-error: "npm:^3.0.0" ansi-escapes: "npm:^4.3.0" @@ -20012,7 +20019,7 @@ __metadata: json-stream-stringify: "npm:^3.1.4" keccak: "npm:^3.0.2" lodash: "npm:^4.17.11" - micro-eth-signer: "npm:^0.14.0" + micro-eth-signer: "npm:^0.16.0" mnemonist: "npm:^0.38.0" mocha: "npm:^10.0.0" p-map: "npm:^4.0.0" @@ -20038,7 +20045,7 @@ __metadata: optional: true bin: hardhat: internal/cli/bootstrap.js - checksum: 10c0/1b29e472c17b2c31894823b45da687ae2a1d17495dc5b6cbdce31979424815e969d61e8f777183154bc922f740b6681a09ef6f38e91d5decd80adb3b68cc7829 + checksum: 10c0/8f94dc8ecc73a590723a3b5d45e29e5fdd16ece0164ef705d571e8bd895944b14d7d294d17fd231b811438f69bd79465ec16252404cf00d39cfcb43f5a84ae35 languageName: node linkType: hard @@ -23205,14 +23212,14 @@ __metadata: languageName: node linkType: hard -"micro-eth-signer@npm:^0.14.0": - version: 0.14.0 - resolution: "micro-eth-signer@npm:0.14.0" +"micro-eth-signer@npm:^0.16.0": + version: 0.16.0 + resolution: "micro-eth-signer@npm:0.16.0" dependencies: - "@noble/curves": "npm:~1.8.1" - "@noble/hashes": "npm:~1.7.1" - micro-packed: "npm:~0.7.2" - checksum: 10c0/62c90d54d2b97cb4eaf713c69bc4ceb5903012d0237c26f0966076cfb89c4527de68b395e1bc29e6f237152ce08f7b551fb57b332003518a1331c2c0890fb164 + "@noble/curves": "npm:~1.9.2" + "@noble/hashes": "npm:2.0.0-beta.1" + micro-packed: "npm:~0.7.3" + checksum: 10c0/daac43e339c3bcb4c1598bfb0cfa83878a25f3464bdbecbf1135dd8ffbe1fa687eec6e5fc82fb5a8d007b5fafcae682f66cddee24724c75c95019625d735a36f languageName: node linkType: hard @@ -23223,7 +23230,7 @@ __metadata: languageName: node linkType: hard -"micro-packed@npm:~0.7.2": +"micro-packed@npm:~0.7.3": version: 0.7.3 resolution: "micro-packed@npm:0.7.3" dependencies: From 73426059ad0119889e3db8db00fe4d24ae518f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= <50665615+flopez7@users.noreply.github.com> Date: Tue, 5 Aug 2025 14:01:05 +0200 Subject: [PATCH 05/14] [Job Launcher][Server] Rate limiting (#3446) --- .../components/Auth/ForgotPasswordForm.jsx | 6 ++- .../job-launcher/client/src/services/auth.ts | 5 ++- .../job-launcher/client/src/types/index.ts | 5 +++ .../apps/job-launcher/server/package.json | 1 + .../job-launcher/server/src/app.module.ts | 44 ++++++++++++------- .../src/modules/auth/auth.controller.ts | 10 +++-- .../server/src/modules/auth/auth.dto.ts | 4 ++ .../src/modules/auth/auth.service.spec.ts | 17 +++++-- .../server/src/modules/auth/auth.service.ts | 18 +++++++- yarn.lock | 12 +++++ 10 files changed, 95 insertions(+), 27 deletions(-) diff --git a/packages/apps/job-launcher/client/src/components/Auth/ForgotPasswordForm.jsx b/packages/apps/job-launcher/client/src/components/Auth/ForgotPasswordForm.jsx index 6be17a87a7..85cf68bfee 100644 --- a/packages/apps/job-launcher/client/src/components/Auth/ForgotPasswordForm.jsx +++ b/packages/apps/job-launcher/client/src/components/Auth/ForgotPasswordForm.jsx @@ -26,7 +26,11 @@ export const ForgotPasswordForm = () => { const handleForgotPassword = async ({ email }) => { setIsLoading(true); try { - await authService.forgotPassword(email); + const hCaptchaToken = await captchaRef.current.getResponse(); + await authService.forgotPassword({ + email, + hCaptchaToken, + }); setIsSuccess(true); } catch (err) { showError(err); diff --git a/packages/apps/job-launcher/client/src/services/auth.ts b/packages/apps/job-launcher/client/src/services/auth.ts index 6681643371..17536d94c0 100644 --- a/packages/apps/job-launcher/client/src/services/auth.ts +++ b/packages/apps/job-launcher/client/src/services/auth.ts @@ -1,4 +1,5 @@ import { + ForgotPasswordRequest, ResetPasswordRequest, SignInRequest, SignUpRequest, @@ -24,8 +25,8 @@ export const signOut = async (refreshToken: string) => { return data; }; -export const forgotPassword = async (email: string) => { - await api.post('/auth/forgot-password', { email }); +export const forgotPassword = async (body: ForgotPasswordRequest) => { + await api.post('/auth/forgot-password', body); }; export const resetPassword = async (body: ResetPasswordRequest) => { diff --git a/packages/apps/job-launcher/client/src/types/index.ts b/packages/apps/job-launcher/client/src/types/index.ts index 58f1c01343..db19cc899d 100644 --- a/packages/apps/job-launcher/client/src/types/index.ts +++ b/packages/apps/job-launcher/client/src/types/index.ts @@ -17,6 +17,11 @@ export type SignUpResponse = { refreshToken: string; }; +export type ForgotPasswordRequest = { + email: string; + hCaptchaToken: string; +}; + export type ResetPasswordRequest = { password: string; token: string; diff --git a/packages/apps/job-launcher/server/package.json b/packages/apps/job-launcher/server/package.json index c1d327fb04..24418f485e 100644 --- a/packages/apps/job-launcher/server/package.json +++ b/packages/apps/job-launcher/server/package.json @@ -43,6 +43,7 @@ "@nestjs/serve-static": "^4.0.1", "@nestjs/swagger": "^7.4.2", "@nestjs/terminus": "^11.0.0", + "@nestjs/throttler": "^6.4.0", "@nestjs/typeorm": "^10.0.1", "@sendgrid/mail": "^8.1.3", "@types/passport-jwt": "^4.0.1", diff --git a/packages/apps/job-launcher/server/src/app.module.ts b/packages/apps/job-launcher/server/src/app.module.ts index b351d7e082..c15f1acdbf 100644 --- a/packages/apps/job-launcher/server/src/app.module.ts +++ b/packages/apps/job-launcher/server/src/app.module.ts @@ -1,31 +1,31 @@ import { Module } from '@nestjs/common'; +import { ConfigModule } from '@nestjs/config'; import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_PIPE } from '@nestjs/core'; -import { ServeStaticModule } from '@nestjs/serve-static'; import { ScheduleModule } from '@nestjs/schedule'; -import { ConfigModule } from '@nestjs/config'; +import { ServeStaticModule } from '@nestjs/serve-static'; +import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler'; import { join } from 'path'; - import { AppController } from './app.controller'; -import { DatabaseModule } from './database/database.module'; +import { EnvConfigModule } from './common/config/config.module'; +import { envValidator } from './common/config/env-schema'; +import { ExceptionFilter } from './common/exceptions/exception.filter'; import { JwtAuthGuard } from './common/guards'; +import { SnakeCaseInterceptor } from './common/interceptors/snake-case'; +import { TransformEnumInterceptor } from './common/interceptors/transform-enum.interceptor'; import { HttpValidationPipe } from './common/pipes'; -import { HealthModule } from './modules/health/health.module'; +import Environment from './common/utils/environment'; +import { DatabaseModule } from './database/database.module'; import { AuthModule } from './modules/auth/auth.module'; -import { UserModule } from './modules/user/user.module'; +import { CronJobModule } from './modules/cron-job/cron-job.module'; +import { HealthModule } from './modules/health/health.module'; import { JobModule } from './modules/job/job.module'; import { PaymentModule } from './modules/payment/payment.module'; -import { Web3Module } from './modules/web3/web3.module'; -import { envValidator } from './common/config/env-schema'; +import { QualificationModule } from './modules/qualification/qualification.module'; +import { StatisticModule } from './modules/statistic/statistic.module'; import { StorageModule } from './modules/storage/storage.module'; -import { CronJobModule } from './modules/cron-job/cron-job.module'; -import { SnakeCaseInterceptor } from './common/interceptors/snake-case'; +import { UserModule } from './modules/user/user.module'; +import { Web3Module } from './modules/web3/web3.module'; import { WebhookModule } from './modules/webhook/webhook.module'; -import { EnvConfigModule } from './common/config/config.module'; -import { ExceptionFilter } from './common/exceptions/exception.filter'; -import { StatisticModule } from './modules/statistic/statistic.module'; -import { QualificationModule } from './modules/qualification/qualification.module'; -import { TransformEnumInterceptor } from './common/interceptors/transform-enum.interceptor'; -import Environment from './common/utils/environment'; @Module({ providers: [ @@ -49,8 +49,20 @@ import Environment from './common/utils/environment'; provide: APP_FILTER, useClass: ExceptionFilter, }, + { + provide: APP_GUARD, + useClass: ThrottlerGuard, + }, ], imports: [ + ThrottlerModule.forRoot({ + throttlers: [ + { + ttl: 60000, + limit: 1000, + }, + ], + }), ScheduleModule.forRoot(), ConfigModule.forRoot({ /** diff --git a/packages/apps/job-launcher/server/src/modules/auth/auth.controller.ts b/packages/apps/job-launcher/server/src/modules/auth/auth.controller.ts index 73566fd130..42c4847b41 100644 --- a/packages/apps/job-launcher/server/src/modules/auth/auth.controller.ts +++ b/packages/apps/job-launcher/server/src/modules/auth/auth.controller.ts @@ -10,7 +10,6 @@ import { UseGuards, UseInterceptors, } from '@nestjs/common'; - import { ApiBearerAuth, ApiBody, @@ -18,6 +17,7 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; +import { Throttle } from '@nestjs/throttler'; import { ErrorAuth } from '../../common/constants/errors'; import { Public } from '../../common/decorators'; import { ValidationError } from '../../common/errors'; @@ -144,6 +144,7 @@ export class AuthJwtController { @Public() @HttpCode(204) + @Throttle({ default: { limit: 3, ttl: 60000 } }) @Post('/forgot-password') @ApiOperation({ summary: 'Forgot Password', @@ -162,8 +163,11 @@ export class AuthJwtController { status: 404, description: 'Not Found. Could not find the requested content.', }) - public async forgotPassword(@Body() data: ForgotPasswordDto): Promise { - await this.authService.forgotPassword(data); + public async forgotPassword( + @Body() data: ForgotPasswordDto, + @Ip() ip: string, + ): Promise { + await this.authService.forgotPassword(data, ip); } @Public() diff --git a/packages/apps/job-launcher/server/src/modules/auth/auth.dto.ts b/packages/apps/job-launcher/server/src/modules/auth/auth.dto.ts index 56015c7c29..2105d23875 100644 --- a/packages/apps/job-launcher/server/src/modules/auth/auth.dto.ts +++ b/packages/apps/job-launcher/server/src/modules/auth/auth.dto.ts @@ -13,6 +13,10 @@ export class ForgotPasswordDto { @IsEmail() @Transform(({ value }: { value: string }) => value.toLowerCase()) public email: string; + + @ApiProperty({ name: 'h_captcha_token' }) + @IsString() + public hCaptchaToken: string; } export class SignInDto { diff --git a/packages/apps/job-launcher/server/src/modules/auth/auth.service.spec.ts b/packages/apps/job-launcher/server/src/modules/auth/auth.service.spec.ts index a525dffe4b..6a49560722 100644 --- a/packages/apps/job-launcher/server/src/modules/auth/auth.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/auth/auth.service.spec.ts @@ -330,7 +330,10 @@ describe('AuthService', () => { it('should throw NotFoundError if user is not found', () => { findByEmailMock.mockResolvedValue(null); expect( - authService.forgotPassword({ email: 'user@example.com' }), + authService.forgotPassword({ + email: 'user@example.com', + hCaptchaToken: 'token', + }), ).rejects.toThrow(new NotFoundError(ErrorUser.NotFound)); }); @@ -338,13 +341,19 @@ describe('AuthService', () => { userEntity.status = UserStatus.INACTIVE; findByEmailMock.mockResolvedValue(userEntity); expect( - authService.forgotPassword({ email: 'user@example.com' }), + authService.forgotPassword({ + email: 'user@example.com', + hCaptchaToken: 'token', + }), ).rejects.toThrow(new ForbiddenError(ErrorUser.UserNotActive)); }); it('should remove existing token if it exists', async () => { findTokenMock.mockResolvedValue(tokenEntity); - await authService.forgotPassword({ email: 'user@example.com' }); + await authService.forgotPassword({ + email: 'user@example.com', + hCaptchaToken: 'token', + }); expect(tokenRepository.deleteOne).toHaveBeenCalled(); }); @@ -353,7 +362,7 @@ describe('AuthService', () => { sendGridService.sendEmail = jest.fn(); const email = 'user@example.com'; - await authService.forgotPassword({ email }); + await authService.forgotPassword({ email, hCaptchaToken: 'token' }); expect(sendGridService.sendEmail).toHaveBeenCalledWith( expect.objectContaining({ diff --git a/packages/apps/job-launcher/server/src/modules/auth/auth.service.ts b/packages/apps/job-launcher/server/src/modules/auth/auth.service.ts index 278f12c0a2..babebfb57c 100644 --- a/packages/apps/job-launcher/server/src/modules/auth/auth.service.ts +++ b/packages/apps/job-launcher/server/src/modules/auth/auth.service.ts @@ -181,7 +181,23 @@ export class AuthService { return { accessToken, refreshToken: newRefreshTokenEntity.uuid }; } - public async forgotPassword(data: ForgotPasswordDto): Promise { + public async forgotPassword( + data: ForgotPasswordDto, + ip?: string, + ): Promise { + if ( + !( + await verifyToken( + this.authConfigService.hcaptchaProtectionUrl, + this.authConfigService.hCaptchaSiteKey, + this.authConfigService.hCaptchaSecret, + data.hCaptchaToken, + ip, + ) + ).success + ) { + throw new ForbiddenError(ErrorAuth.InvalidCaptchaToken); + } const userEntity = await this.userRepository.findByEmail(data.email); if (!userEntity) { diff --git a/yarn.lock b/yarn.lock index e7dc3a97a2..997583f217 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4434,6 +4434,7 @@ __metadata: "@nestjs/swagger": "npm:^7.4.2" "@nestjs/terminus": "npm:^11.0.0" "@nestjs/testing": "npm:^10.4.6" + "@nestjs/throttler": "npm:^6.4.0" "@nestjs/typeorm": "npm:^10.0.1" "@sendgrid/mail": "npm:^8.1.3" "@types/bcrypt": "npm:^5.0.2" @@ -6706,6 +6707,17 @@ __metadata: languageName: node linkType: hard +"@nestjs/throttler@npm:^6.4.0": + version: 6.4.0 + resolution: "@nestjs/throttler@npm:6.4.0" + peerDependencies: + "@nestjs/common": ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 + "@nestjs/core": ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 + reflect-metadata: ^0.1.13 || ^0.2.0 + checksum: 10c0/796134644e341aad4a403b7431524db97adc31ae8771fc1160a4694a24c295b7a3dd15abcb72b9ea3a0702247b929f501fc5dc74a3f30d915f2667a39ba5c5d7 + languageName: node + linkType: hard + "@nestjs/typeorm@npm:^10.0.1": version: 10.0.2 resolution: "@nestjs/typeorm@npm:10.0.2" From 82456f163f8849df4a52071a3068c7c56360e09a Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Tue, 5 Aug 2025 17:10:38 +0300 Subject: [PATCH 06/14] [CVAT] Fix empty GT frames in point annotation task (#3492) --- .../cvat/exchange-oracle/src/handlers/job_creation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py b/packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py index 1f94262a3f..b206ca71fa 100644 --- a/packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py +++ b/packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py @@ -478,7 +478,9 @@ def _parse_gt_dataset(self, gt_file_data, *, add_prefix=None): sample_points.extend(bbox_center.points) # Join points into a single annotation for compatibility with CVAT capabilities - updated_anns = [dm.Points(sample_points, label=label_id)] + updated_anns = [] + if sample_points: + updated_anns.append(dm.Points(sample_points, label=label_id)) updated_gt_dataset.put(gt_sample.wrap(annotations=updated_anns)) From 39d9eb71d910afc675e7f0f46061a949ff7781c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= <50665615+flopez7@users.noreply.github.com> Date: Wed, 6 Aug 2025 15:07:19 +0200 Subject: [PATCH 07/14] [Job Launcher] Fix rate limit (#3494) --- packages/apps/job-launcher/server/src/main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/apps/job-launcher/server/src/main.ts b/packages/apps/job-launcher/server/src/main.ts index 1ee1a55318..f02955d80c 100644 --- a/packages/apps/job-launcher/server/src/main.ts +++ b/packages/apps/job-launcher/server/src/main.ts @@ -1,4 +1,3 @@ -import { INestApplication } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { NestFactory } from '@nestjs/core'; @@ -9,9 +8,10 @@ import helmet from 'helmet'; import { AppModule } from './app.module'; import { ServerConfigService } from './common/config/server-config.service'; import logger, { nestLoggerOverride } from './logger'; +import { NestExpressApplication } from '@nestjs/platform-express'; async function bootstrap() { - const app = await NestFactory.create(AppModule, { + const app = await NestFactory.create(AppModule, { cors: { exposedHeaders: ['Content-Disposition'], }, @@ -19,6 +19,7 @@ async function bootstrap() { }); useContainer(app.select(AppModule), { fallbackOnErrors: true }); + app.set('trust proxy', 2); app.use(json({ limit: '5mb' })); app.use(urlencoded({ limit: '5mb', extended: true })); From d1805ed4d9d6aadc49422d8f938f92a989fa3998 Mon Sep 17 00:00:00 2001 From: Dmitry Nechay Date: Wed, 6 Aug 2025 17:59:42 +0300 Subject: [PATCH 08/14] [Fortune] feat: use shared logger (#3493) --- .../fortune/exchange-oracle/server/Dockerfile | 1 + .../exchange-oracle/server/package.json | 1 + .../exchange-oracle/server/src/app.module.ts | 3 +- .../server/src/common/config/env-schema.ts | 1 - .../common/config/server-config.service.ts | 8 ---- .../src/common/exceptions/exception.filter.ts | 19 ++++---- .../src/common/guards/signature.auth.ts | 28 ++++++----- .../server/src/common/utils/environment.ts | 25 ++++++++++ .../server/src/database/database.module.ts | 13 ++---- .../server/src/logger/index.ts | 24 ++++++++++ .../exchange-oracle/server/src/main.ts | 23 ++-------- .../modules/assignment/assignment.service.ts | 20 ++++---- .../src/modules/cron-job/cron-job.service.ts | 34 ++++++++------ .../server/src/modules/job/job.service.ts | 6 +-- .../server/src/modules/stats/stats.service.ts | 3 +- .../src/modules/storage/storage.service.ts | 24 +++++++--- .../server/src/modules/web3/web3.service.ts | 17 ++++--- .../src/modules/webhook/webhook.module.ts | 4 +- .../src/modules/webhook/webhook.service.ts | 17 ++++--- .../exchange-oracle/server/typeorm.config.ts | 9 ++-- .../apps/fortune/recording-oracle/Dockerfile | 1 + .../fortune/recording-oracle/package.json | 1 + .../scripts/setup-kv-store.ts | 1 + .../recording-oracle/src/app.module.ts | 3 +- .../src/common/config/env-schema.ts | 1 - .../common/config/server-config.service.ts | 8 ---- .../src/common/exceptions/exception.filter.ts | 13 +++--- .../src/common/utils/environment.ts | 25 ++++++++++ .../src/common/utils/webhook.ts | 5 +- .../recording-oracle/src/logger/index.ts | 24 ++++++++++ .../apps/fortune/recording-oracle/src/main.ts | 8 ++-- .../src/modules/job/job.module.ts | 4 +- .../src/modules/job/job.service.ts | 46 ++++++++++++------- yarn.lock | 2 + 34 files changed, 266 insertions(+), 156 deletions(-) create mode 100644 packages/apps/fortune/exchange-oracle/server/src/common/utils/environment.ts create mode 100644 packages/apps/fortune/exchange-oracle/server/src/logger/index.ts create mode 100644 packages/apps/fortune/recording-oracle/src/common/utils/environment.ts create mode 100644 packages/apps/fortune/recording-oracle/src/logger/index.ts diff --git a/packages/apps/fortune/exchange-oracle/server/Dockerfile b/packages/apps/fortune/exchange-oracle/server/Dockerfile index 2be71aa6b6..ec1f060ae8 100644 --- a/packages/apps/fortune/exchange-oracle/server/Dockerfile +++ b/packages/apps/fortune/exchange-oracle/server/Dockerfile @@ -16,6 +16,7 @@ COPY ${APP_PATH}/package.json ./${APP_PATH}/ # so we need to copy and build them COPY packages/core ./packages/core COPY packages/sdk ./packages/sdk +COPY packages/libs ./packages/libs RUN yarn install diff --git a/packages/apps/fortune/exchange-oracle/server/package.json b/packages/apps/fortune/exchange-oracle/server/package.json index 5e57ee6136..e250a658bb 100644 --- a/packages/apps/fortune/exchange-oracle/server/package.json +++ b/packages/apps/fortune/exchange-oracle/server/package.json @@ -28,6 +28,7 @@ "generate-env-doc": "ts-node scripts/generate-env-doc.ts" }, "dependencies": { + "@human-protocol/logger": "workspace:*", "@human-protocol/sdk": "workspace:*", "@nestjs/axios": "^3.1.2", "@nestjs/common": "^10.2.7", diff --git a/packages/apps/fortune/exchange-oracle/server/src/app.module.ts b/packages/apps/fortune/exchange-oracle/server/src/app.module.ts index 93f9f3f51f..2008f946c5 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/app.module.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/app.module.ts @@ -19,6 +19,7 @@ import { UserModule } from './modules/user/user.module'; import { Web3Module } from './modules/web3/web3.module'; import { WebhookModule } from './modules/webhook/webhook.module'; import { HttpValidationPipe } from './common/pipes'; +import Environment from './common/utils/environment'; @Module({ providers: [ @@ -54,7 +55,7 @@ import { HttpValidationPipe } from './common/pipes'; /** * First value found takes precendece */ - envFilePath: [`.env.${process.env.NODE_ENV}`, '.env.local', '.env'], + envFilePath: [`.env.${Environment.name}`, '.env.local', '.env'], validationSchema: envValidator, }), DatabaseModule, diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/config/env-schema.ts b/packages/apps/fortune/exchange-oracle/server/src/common/config/env-schema.ts index 08f10c9732..6365d1357a 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/config/env-schema.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/config/env-schema.ts @@ -2,7 +2,6 @@ import * as Joi from 'joi'; export const envValidator = Joi.object({ // General - NODE_ENV: Joi.string(), HOST: Joi.string(), PORT: Joi.string(), FE_URL: Joi.string(), diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/config/server-config.service.ts b/packages/apps/fortune/exchange-oracle/server/src/common/config/server-config.service.ts index 7b140780c5..3fbea478dd 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/config/server-config.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/config/server-config.service.ts @@ -5,14 +5,6 @@ import { ConfigService } from '@nestjs/config'; export class ServerConfigService { constructor(private configService: ConfigService) {} - /** - * The environment in which the server is running (e.g., 'development', 'production'). - * Default: 'development' - */ - get nodeEnv(): string { - return this.configService.get('NODE_ENV', 'development'); - } - /** * The hostname or IP address on which the server will run. * Default: 'localhost' diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts index 875fbb43f7..8ed9509ce3 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts @@ -3,9 +3,10 @@ import { Catch, ExceptionFilter as IExceptionFilter, HttpStatus, - Logger, } from '@nestjs/common'; import { Request, Response } from 'express'; + +import logger from '../../logger'; import { ValidationError, AuthError, @@ -18,7 +19,7 @@ import { @Catch() export class ExceptionFilter implements IExceptionFilter { - private logger = new Logger(ExceptionFilter.name); + private readonly logger = logger.child({ context: ExceptionFilter.name }); private getStatus(exception: any): number { if (exception instanceof ValidationError) { @@ -35,10 +36,11 @@ export class ExceptionFilter implements IExceptionFilter { return HttpStatus.UNPROCESSABLE_ENTITY; } else if (exception instanceof DatabaseError) { return HttpStatus.UNPROCESSABLE_ENTITY; - } else if (exception.statusCode) { - return exception.statusCode; } - return HttpStatus.INTERNAL_SERVER_ERROR; + + const exceptionStatusCode = exception.statusCode || exception.status; + + return exceptionStatusCode || HttpStatus.INTERNAL_SERVER_ERROR; } catch(exception: any, host: ArgumentsHost) { @@ -49,10 +51,9 @@ export class ExceptionFilter implements IExceptionFilter { const status = this.getStatus(exception); const message = exception.message || 'Internal server error'; - this.logger.error( - `Exception caught: ${message}`, - exception.stack || 'No stack trace available', - ); + if (status === HttpStatus.INTERNAL_SERVER_ERROR) { + this.logger.error('Unhandled exception', exception); + } response.status(status).json({ status_code: status, diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/guards/signature.auth.ts b/packages/apps/fortune/exchange-oracle/server/src/common/guards/signature.auth.ts index 97782a8d59..b728d7da90 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/guards/signature.auth.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/guards/signature.auth.ts @@ -1,11 +1,7 @@ import { EscrowUtils } from '@human-protocol/sdk'; -import { - CanActivate, - ExecutionContext, - Injectable, - Logger, -} from '@nestjs/common'; +import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; + import { AssignmentRepository } from '../../modules/assignment/assignment.repository'; import { HEADER_SIGNATURE_KEY } from '../constant'; import { ErrorAssignment, ErrorSignature } from '../constant/errors'; @@ -15,9 +11,8 @@ import { verifySignature } from '../utils/signature'; @Injectable() export class SignatureAuthGuard implements CanActivate { - private readonly logger = new Logger(SignatureAuthGuard.name); constructor( - private reflector: Reflector, + private readonly reflector: Reflector, private readonly assignmentRepository: AssignmentRepository, ) {} @@ -59,15 +54,18 @@ export class SignatureAuthGuard implements CanActivate { oracleAdresses.push(escrowData.reputationOracle!); } } + + let isVerified = false; try { - const isVerified = verifySignature(data, signature, oracleAdresses); - if (isVerified) { - return true; - } - } catch (error) { - this.logger.error(error); + isVerified = verifySignature(data, signature, oracleAdresses); + } catch { + // noop + } + + if (!isVerified) { + throw new AuthError('Unauthorized'); } - throw new AuthError('Unauthorized'); + return true; } } diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/utils/environment.ts b/packages/apps/fortune/exchange-oracle/server/src/common/utils/environment.ts new file mode 100644 index 0000000000..eea42cf768 --- /dev/null +++ b/packages/apps/fortune/exchange-oracle/server/src/common/utils/environment.ts @@ -0,0 +1,25 @@ +enum EnvironmentName { + LOCAL = 'local', + DEVELOPMENT = 'development', + TEST = 'test', + STAGING = 'staging', +} + +class Environment { + static readonly name: string = + process.env.NODE_ENV || EnvironmentName.DEVELOPMENT; + + static isDevelopment(): boolean { + return [ + EnvironmentName.DEVELOPMENT, + EnvironmentName.TEST, + EnvironmentName.LOCAL, + ].includes(Environment.name as EnvironmentName); + } + + static isTest(): boolean { + return Environment.name === EnvironmentName.TEST; + } +} + +export default Environment; diff --git a/packages/apps/fortune/exchange-oracle/server/src/database/database.module.ts b/packages/apps/fortune/exchange-oracle/server/src/database/database.module.ts index f67c3dd43e..a5a47459e1 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/database/database.module.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/database/database.module.ts @@ -3,30 +3,24 @@ import { ConfigModule } from '@nestjs/config'; import { TypeOrmModule } from '@nestjs/typeorm'; import * as path from 'path'; import { SnakeNamingStrategy } from 'typeorm-naming-strategies'; -import { NS } from '../common/constant'; +import { LoggerOptions } from 'typeorm'; +import { NS } from '../common/constant'; import { TypeOrmLoggerModule, TypeOrmLoggerService } from './typeorm'; -import { LoggerOptions } from 'typeorm'; import { JobEntity } from '../modules/job/job.entity'; import { AssignmentEntity } from '../modules/assignment/assignment.entity'; import { WebhookEntity } from '../modules/webhook/webhook.entity'; import { CronJobEntity } from '../modules/cron-job/cron-job.entity'; import { DatabaseConfigService } from '../common/config/database-config.service'; -import { ServerConfigService } from '../common/config/server-config.service'; @Module({ imports: [ TypeOrmModule.forRootAsync({ imports: [TypeOrmLoggerModule, ConfigModule], - inject: [ - TypeOrmLoggerService, - DatabaseConfigService, - ServerConfigService, - ], + inject: [TypeOrmLoggerService, DatabaseConfigService], useFactory: ( typeOrmLoggerService: TypeOrmLoggerService, databaseConfigService: DatabaseConfigService, - serverConfigService: ServerConfigService, ) => { const loggerOptions = databaseConfigService.logging.split(', '); typeOrmLoggerService.setOptions( @@ -58,7 +52,6 @@ import { ServerConfigService } from '../common/config/server-config.service'; username: databaseConfigService.user, password: databaseConfigService.password, database: databaseConfigService.database, - keepConnectionAlive: serverConfigService.nodeEnv === 'test', migrationsRun: false, ssl: databaseConfigService.ssl, }; diff --git a/packages/apps/fortune/exchange-oracle/server/src/logger/index.ts b/packages/apps/fortune/exchange-oracle/server/src/logger/index.ts new file mode 100644 index 0000000000..1c026ef0e2 --- /dev/null +++ b/packages/apps/fortune/exchange-oracle/server/src/logger/index.ts @@ -0,0 +1,24 @@ +import { createLogger, NestLogger, LogLevel } from '@human-protocol/logger'; + +import Environment from '../common/utils/environment'; + +const isDevelopment = Environment.isDevelopment(); + +const defaultLogger = createLogger( + { + name: 'DefaultLogger', + level: isDevelopment ? LogLevel.DEBUG : LogLevel.INFO, + pretty: isDevelopment, + disabled: Environment.isTest(), + }, + { + environment: Environment.name, + service: 'fortune-exchange-oracle', + }, +); + +export const nestLoggerOverride = new NestLogger( + defaultLogger.child({ name: 'NestLogger' }), +); + +export default defaultLogger; diff --git a/packages/apps/fortune/exchange-oracle/server/src/main.ts b/packages/apps/fortune/exchange-oracle/server/src/main.ts index 2683f7c886..7e9b71d883 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/main.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/main.ts @@ -1,16 +1,18 @@ +import { INestApplication, ValidationPipe } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { NestFactory } from '@nestjs/core'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { json, urlencoded } from 'body-parser'; import { useContainer } from 'class-validator'; -import { AppModule } from './app.module'; -import { INestApplication, ValidationPipe } from '@nestjs/common'; import { ServerConfigService } from './common/config/server-config.service'; +import logger, { nestLoggerOverride } from './logger'; +import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule, { cors: true, + logger: nestLoggerOverride, }); const configService: ConfigService = app.get(ConfigService); @@ -19,21 +21,6 @@ async function bootstrap() { const host = serverConfigService.host; const port = serverConfigService.port; - // app.enableCors({ - // origin: - // process.env.NODE_ENV === 'development' || - // process.env.NODE_ENV === 'staging' - // ? [ - // `http://localhost:${port}`, - // `http://127.0.0.1:${port}`, - // `http://0.0.0.0:${port}`, - // `http://${host}:${port}`, - // ] - // : [`http://${host}:${port}`], - // credentials: true, - // exposedHeaders: ['Content-Disposition'], - // }); - useContainer(app.select(AppModule), { fallbackOnErrors: true }); app.use(json({ limit: '5mb' })); @@ -51,7 +38,7 @@ async function bootstrap() { app.useGlobalPipes(new ValidationPipe({ transform: true })); await app.listen(port, host, async () => { - console.info(`API server is running on http://${host}:${port}`); + logger.info(`API server is running on http://${host}:${port}`); }); } diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.service.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.service.ts index 55cffad2b7..40fc11371c 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.service.ts @@ -1,5 +1,7 @@ import { Escrow__factory } from '@human-protocol/core/typechain-types'; -import { Injectable, Logger } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; + +import logger from '../../logger'; import { ServerConfigService } from '../../common/config/server-config.service'; import { ErrorAssignment, ErrorJob } from '../../common/constant/errors'; import { AssignmentStatus, JobStatus, JobType } from '../../common/enums/job'; @@ -23,7 +25,7 @@ import { AssignmentRepository } from './assignment.repository'; @Injectable() export class AssignmentService { - private readonly logger = new Logger(AssignmentService.name); + private readonly logger = logger.child({ context: AssignmentService.name }); constructor( private readonly assignmentRepository: AssignmentRepository, @@ -43,16 +45,15 @@ export class AssignmentService { ); if (!jobEntity) { - this.logger.log(ErrorAssignment.JobNotFound, AssignmentService.name); throw new ServerError(ErrorAssignment.JobNotFound); } else if (jobEntity.status !== JobStatus.ACTIVE) { - this.logger.log(ErrorJob.InvalidStatus, AssignmentService.name); throw new ConflictError(ErrorJob.InvalidStatus); } else if (jobEntity.reputationNetwork !== jwtUser.reputationNetwork) { - this.logger.log( - ErrorAssignment.ReputationNetworkMismatch, - AssignmentService.name, - ); + this.logger.warn(ErrorAssignment.ReputationNetworkMismatch, { + chainId: data.chainId, + escrowAddress: data.escrowAddress, + jobEntityId: jobEntity.id, + }); throw new ValidationError(ErrorAssignment.ReputationNetworkMismatch); } @@ -66,7 +67,6 @@ export class AssignmentService { assignmentEntity && assignmentEntity.status !== AssignmentStatus.CANCELED ) { - this.logger.log(ErrorAssignment.AlreadyExists, AssignmentService.name); throw new ConflictError(ErrorAssignment.AlreadyExists); } @@ -90,7 +90,6 @@ export class AssignmentService { } if (currentAssignments >= manifest.submissionsRequired) { - this.logger.log(ErrorAssignment.FullyAssigned, AssignmentService.name); throw new ValidationError(ErrorAssignment.FullyAssigned); } @@ -98,7 +97,6 @@ export class AssignmentService { const escrow = Escrow__factory.connect(data.escrowAddress, signer); const expirationDate = new Date(Number(await escrow.duration()) * 1000); if (expirationDate < new Date()) { - this.logger.log(ErrorAssignment.ExpiredEscrow, AssignmentService.name); throw new ValidationError(ErrorAssignment.ExpiredEscrow); } diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/cron-job/cron-job.service.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/cron-job/cron-job.service.ts index 9b1d31631b..9bd649a3fe 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/cron-job/cron-job.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/cron-job/cron-job.service.ts @@ -1,6 +1,7 @@ -import { Injectable, Logger } from '@nestjs/common'; - +import { Injectable } from '@nestjs/common'; import { Cron } from '@nestjs/schedule'; + +import logger from '../../logger'; import { ErrorCronJob } from '../../common/constant/errors'; import { CronJobType } from '../../common/enums/cron-job'; import { WebhookStatus } from '../../common/enums/webhook'; @@ -11,7 +12,7 @@ import { CronJobRepository } from './cron-job.repository'; @Injectable() export class CronJobService { - private readonly logger = new Logger(CronJobService.name); + private readonly logger = logger.child({ context: CronJobService.name }); constructor( private readonly cronJobRepository: CronJobRepository, @@ -19,7 +20,7 @@ export class CronJobService { private readonly webhookRepository: WebhookRepository, ) {} - public async startCronJob(cronJobType: CronJobType): Promise { + async startCronJob(cronJobType: CronJobType): Promise { const cronJob = await this.cronJobRepository.findOneByType(cronJobType); if (!cronJob) { @@ -32,14 +33,15 @@ export class CronJobService { return this.cronJobRepository.updateOne(cronJob); } - public async isCronJobRunning(cronJobType: CronJobType): Promise { + async isCronJobRunning(cronJobType: CronJobType): Promise { const lastCronJob = await this.cronJobRepository.findOneByType(cronJobType); if (!lastCronJob || lastCronJob.completedAt) { return false; } - this.logger.log('Previous cron job is not completed yet'); + this.logger.warn('Previous cron job is not completed yet', { cronJobType }); + return true; } @@ -47,7 +49,9 @@ export class CronJobService { cronJobEntity: CronJobEntity, ): Promise { if (cronJobEntity.completedAt) { - this.logger.error(ErrorCronJob.Completed, CronJobService.name); + this.logger.error(ErrorCronJob.Completed, { + cronJobType: cronJobEntity.cronJobType, + }); throw new Error(ErrorCronJob.Completed); } @@ -69,7 +73,7 @@ export class CronJobService { return; } - this.logger.log('Pending webhooks START'); + this.logger.info('Pending webhooks START'); const cronJob = await this.startCronJob(CronJobType.ProcessPendingWebhook); try { @@ -80,19 +84,23 @@ export class CronJobService { for (const webhookEntity of webhookEntities) { try { await this.webhookService.sendWebhook(webhookEntity); - } catch (err) { - this.logger.error(`Error sending webhook: ${err.message}`); + } catch (error) { + this.logger.error('Error sending webhook', { + error, + webhookId: webhookEntity.id, + }); await this.webhookService.handleWebhookError(webhookEntity); continue; } webhookEntity.status = WebhookStatus.COMPLETED; await this.webhookRepository.updateOne(webhookEntity); } - } catch (e) { - this.logger.error(e); + } catch (error) { + this.logger.error('Error processing pending webhooks', error); } - this.logger.log('Pending webhooks STOP'); + this.logger.info('Pending webhooks STOP'); + await this.completeCronJob(cronJob); } } 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 ff17236276..3b89ea8a23 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 @@ -9,7 +9,8 @@ import { EscrowClient, StorageClient, } from '@human-protocol/sdk'; -import { Inject, Injectable, Logger } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common'; + import { PGPConfigService } from '../../common/config/pgp-config.service'; import { ErrorAssignment, ErrorJob } from '../../common/constant/errors'; import { SortDirection } from '../../common/enums/collection'; @@ -42,8 +43,6 @@ import { JobRepository } from './job.repository'; @Injectable() export class JobService { - public readonly logger = new Logger(JobService.name); - constructor( private readonly pgpConfigService: PGPConfigService, public readonly jobRepository: JobRepository, @@ -63,7 +62,6 @@ export class JobService { ); if (jobEntity) { - this.logger.log(ErrorJob.AlreadyExists, JobService.name); throw new ConflictError(ErrorJob.AlreadyExists); } diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/stats/stats.service.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/stats/stats.service.ts index 1ca6ee1d3c..446029f8d6 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/stats/stats.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/stats/stats.service.ts @@ -1,4 +1,4 @@ -import { Injectable, Logger } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { JobRepository } from '../job/job.repository'; import { AssignmentRepository } from '../assignment/assignment.repository'; import { AssignmentStatsDto, OracleStatsDto } from './stats.dto'; @@ -6,7 +6,6 @@ import { JobStatus } from '../../common/enums/job'; @Injectable() export class StatsService { - public readonly logger = new Logger(StatsService.name); constructor( private jobRepository: JobRepository, private assignmentRepository: AssignmentRepository, diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/storage/storage.service.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/storage/storage.service.ts index b18126bdf9..c885e0b6b1 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/storage/storage.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/storage/storage.service.ts @@ -6,8 +6,10 @@ import { KVStoreUtils, StorageClient, } from '@human-protocol/sdk'; -import { Inject, Injectable, Logger } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common'; import * as Minio from 'minio'; + +import logger from '../../logger'; import { PGPConfigService } from '../../common/config/pgp-config.service'; import { S3ConfigService } from '../../common/config/s3-config.service'; import { NotFoundError, ServerError } from '../../common/errors'; @@ -16,7 +18,8 @@ import { Web3Service } from '../web3/web3.service'; @Injectable() export class StorageService { - public readonly minioClient: Minio.Client; + private readonly logger = logger.child({ context: StorageService.name }); + readonly minioClient: Minio.Client; constructor( @Inject(Web3Service) @@ -101,8 +104,13 @@ export class StorageService { exchangeOraclePublickKey, recordingOraclePublicKey, ]); - } catch (e) { - Logger.error(e); + } catch (error) { + this.logger.error('Failed to encrypt job solutions', { + chainId, + escrowAddress, + error, + }); + throw new ServerError('Encryption error'); } } @@ -119,8 +127,12 @@ export class StorageService { ); return this.getJobUrl(escrowAddress, chainId); - } catch (e) { - Logger.error(e); + } catch (error) { + this.logger.error('Failed to upload job solutions', { + chainId, + escrowAddress, + error, + }); throw new ServerError('File not uploaded'); } } diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/web3/web3.service.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/web3/web3.service.ts index 855d1627f0..99fb7413da 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/web3/web3.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/web3/web3.service.ts @@ -1,5 +1,8 @@ -import { BadRequestException, Injectable, Logger } from '@nestjs/common'; +import { ChainId } from '@human-protocol/sdk'; +import { BadRequestException, Injectable } from '@nestjs/common'; import { Wallet, ethers } from 'ethers'; + +import logger from '../../logger'; import { Web3Env } from '../../common/enums/web3'; import { LOCALHOST_CHAIN_IDS, @@ -7,20 +10,20 @@ import { TESTNET_CHAIN_IDS, } from '../../common/constant'; import { ErrorWeb3 } from '../../common/constant/errors'; -import { ChainId } from '@human-protocol/sdk'; import { Web3ConfigService } from '../../common/config/web3-config.service'; import { NetworkConfigService } from '../../common/config/network-config.service'; @Injectable() export class Web3Service { + private readonly logger = logger.child({ context: Web3Service.name }); + private signers: { [key: number]: Wallet } = {}; - public readonly logger = new Logger(Web3Service.name); - public readonly signerAddress: string; - public readonly currentWeb3Env: string; + readonly signerAddress: string; + readonly currentWeb3Env: string; constructor( private readonly web3ConfigService: Web3ConfigService, - public readonly networkConfigService: NetworkConfigService, + readonly networkConfigService: NetworkConfigService, ) { const privateKey = this.web3ConfigService.privateKey; const validChains = this.getValidChains(); @@ -43,7 +46,7 @@ export class Web3Service { public validateChainId(chainId: number): void { const validChainIds = this.getValidChains(); if (!validChainIds.includes(chainId)) { - this.logger.log(ErrorWeb3.InvalidChainId, Web3Service.name); + this.logger.error(ErrorWeb3.InvalidChainId, { chainId }); throw new BadRequestException(ErrorWeb3.InvalidChainId); } } diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.module.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.module.ts index 25c1720873..334112a6fa 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.module.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.module.ts @@ -1,4 +1,4 @@ -import { Logger, Module } from '@nestjs/common'; +import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { ConfigModule } from '@nestjs/config'; @@ -25,7 +25,7 @@ import { AssignmentEntity } from '../assignment/assignment.entity'; AssignmentModule, ], controllers: [WebhookController], - providers: [Logger, WebhookService, WebhookRepository, AssignmentRepository], + providers: [WebhookService, WebhookRepository, AssignmentRepository], exports: [WebhookService], }) export class WebhookModule {} 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 32fa800d0c..f2bbf9bbfc 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 @@ -1,8 +1,10 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { ChainId, EscrowClient, OperatorUtils } from '@human-protocol/sdk'; import { HttpService } from '@nestjs/axios'; -import { Injectable, Logger } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { firstValueFrom } from 'rxjs'; + +import logger from '../../logger'; import { ServerConfigService } from '../../common/config/server-config.service'; import { Web3ConfigService } from '../../common/config/web3-config.service'; import { HEADER_SIGNATURE_KEY } from '../../common/constant'; @@ -21,16 +23,16 @@ import { WebhookRepository } from './webhook.repository'; @Injectable() export class WebhookService { - private readonly logger = new Logger(WebhookService.name); + private readonly logger = logger.child({ context: WebhookService.name }); constructor( private readonly webhookRepository: WebhookRepository, private readonly jobService: JobService, - public readonly web3ConfigService: Web3ConfigService, - public readonly serverConfigService: ServerConfigService, - public readonly httpService: HttpService, - public readonly web3Service: Web3Service, - public readonly storageService: StorageService, + private readonly web3ConfigService: Web3ConfigService, + private readonly serverConfigService: ServerConfigService, + private readonly httpService: HttpService, + private readonly web3Service: Web3Service, + private readonly storageService: StorageService, ) {} public async handleWebhook(webhook: WebhookDto): Promise { @@ -124,6 +126,7 @@ export class WebhookService { } catch (error) { const formattedError = formatAxiosError(error); this.logger.error('Webhook not sent', { + webhookId: webhook.id, error: formattedError, }); throw new Error(formattedError.message); diff --git a/packages/apps/fortune/exchange-oracle/server/typeorm.config.ts b/packages/apps/fortune/exchange-oracle/server/typeorm.config.ts index 040b3c1c94..4fe91e67f2 100644 --- a/packages/apps/fortune/exchange-oracle/server/typeorm.config.ts +++ b/packages/apps/fortune/exchange-oracle/server/typeorm.config.ts @@ -2,10 +2,13 @@ import { DataSource } from 'typeorm'; import { SnakeNamingStrategy } from 'typeorm-naming-strategies'; import * as dotenv from 'dotenv'; +import Environment from './src/common/utils/environment'; + dotenv.config({ - path: process.env.NODE_ENV - ? `.env.${process.env.NODE_ENV as string}` - : '.env', + /** + * First value wins if "override" option is not set + */ + path: [`.env.${Environment.name}`, '.env'], }); export default new DataSource({ diff --git a/packages/apps/fortune/recording-oracle/Dockerfile b/packages/apps/fortune/recording-oracle/Dockerfile index 2467774a14..2b7cfc933b 100644 --- a/packages/apps/fortune/recording-oracle/Dockerfile +++ b/packages/apps/fortune/recording-oracle/Dockerfile @@ -16,6 +16,7 @@ COPY ${APP_PATH}/package.json ./${APP_PATH}/ # so we need to copy and build them COPY packages/core ./packages/core COPY packages/sdk ./packages/sdk +COPY packages/libs ./packages/libs RUN yarn install diff --git a/packages/apps/fortune/recording-oracle/package.json b/packages/apps/fortune/recording-oracle/package.json index 2be152290d..e619406f7d 100644 --- a/packages/apps/fortune/recording-oracle/package.json +++ b/packages/apps/fortune/recording-oracle/package.json @@ -23,6 +23,7 @@ "generate-env-doc": "ts-node scripts/generate-env-doc.ts" }, "dependencies": { + "@human-protocol/logger": "workspace:*", "@human-protocol/sdk": "workspace:*", "@nestjs/axios": "^3.1.2", "@nestjs/common": "^10.2.7", diff --git a/packages/apps/fortune/recording-oracle/scripts/setup-kv-store.ts b/packages/apps/fortune/recording-oracle/scripts/setup-kv-store.ts index 99a865bd08..832a23589d 100644 --- a/packages/apps/fortune/recording-oracle/scripts/setup-kv-store.ts +++ b/packages/apps/fortune/recording-oracle/scripts/setup-kv-store.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { KVStoreClient, KVStoreKeys, Role } from '@human-protocol/sdk'; import * as dotenv from 'dotenv'; import { Wallet, ethers } from 'ethers'; diff --git a/packages/apps/fortune/recording-oracle/src/app.module.ts b/packages/apps/fortune/recording-oracle/src/app.module.ts index 68951d8b53..480dd66f9d 100644 --- a/packages/apps/fortune/recording-oracle/src/app.module.ts +++ b/packages/apps/fortune/recording-oracle/src/app.module.ts @@ -11,6 +11,7 @@ import { envValidator } from './common/config/env-schema'; import { EnvConfigModule } from './common/config/config.module'; import { TransformEnumInterceptor } from './common/interceptors/transform-enum.interceptor'; import { ExceptionFilter } from './common/exceptions/exception.filter'; +import Environment from './common/utils/environment'; @Module({ providers: [ @@ -36,7 +37,7 @@ import { ExceptionFilter } from './common/exceptions/exception.filter'; /** * First value found takes precendece */ - envFilePath: [`.env.${process.env.NODE_ENV}`, '.env.local', '.env'], + envFilePath: [`.env.${Environment.name}`, '.env.local', '.env'], validationSchema: envValidator, }), JobModule, diff --git a/packages/apps/fortune/recording-oracle/src/common/config/env-schema.ts b/packages/apps/fortune/recording-oracle/src/common/config/env-schema.ts index 0bbd2c5e19..66bea4e59b 100644 --- a/packages/apps/fortune/recording-oracle/src/common/config/env-schema.ts +++ b/packages/apps/fortune/recording-oracle/src/common/config/env-schema.ts @@ -2,7 +2,6 @@ import * as Joi from 'joi'; export const envValidator = Joi.object({ // General - NODE_ENV: Joi.string(), HOST: Joi.string(), PORT: Joi.string(), // Web3 diff --git a/packages/apps/fortune/recording-oracle/src/common/config/server-config.service.ts b/packages/apps/fortune/recording-oracle/src/common/config/server-config.service.ts index 037d70e5ac..f13fbed973 100644 --- a/packages/apps/fortune/recording-oracle/src/common/config/server-config.service.ts +++ b/packages/apps/fortune/recording-oracle/src/common/config/server-config.service.ts @@ -5,14 +5,6 @@ import { ConfigService } from '@nestjs/config'; export class ServerConfigService { constructor(private configService: ConfigService) {} - /** - * The environment in which the server is running (e.g., 'development', 'production'). - * Default: 'development' - */ - get nodeEnv(): string { - return this.configService.get('NODE_ENV', 'development'); - } - /** * The hostname or IP address on which the server will run. * Default: 'localhost' diff --git a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts index 655aca6ac3..5b6e36df7a 100644 --- a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts @@ -3,9 +3,10 @@ import { Catch, ExceptionFilter as IExceptionFilter, HttpStatus, - Logger, } from '@nestjs/common'; import { Request, Response } from 'express'; + +import logger from '../../logger'; import { ValidationError, AuthError, @@ -17,7 +18,8 @@ import { @Catch() export class ExceptionFilter implements IExceptionFilter { - private logger = new Logger(ExceptionFilter.name); + private readonly logger = logger.child({ context: ExceptionFilter.name }); + private getStatus(exception: any): number { if (exception instanceof ValidationError) { return HttpStatus.BAD_REQUEST; @@ -45,10 +47,9 @@ export class ExceptionFilter implements IExceptionFilter { const status = this.getStatus(exception); const message = exception.message || 'Internal server error'; - this.logger.error( - `Exception caught: ${message}`, - exception.stack || 'No stack trace available', - ); + if (status === HttpStatus.INTERNAL_SERVER_ERROR) { + this.logger.error('Unhandled exception', exception); + } response.status(status).json({ status_code: status, diff --git a/packages/apps/fortune/recording-oracle/src/common/utils/environment.ts b/packages/apps/fortune/recording-oracle/src/common/utils/environment.ts new file mode 100644 index 0000000000..eea42cf768 --- /dev/null +++ b/packages/apps/fortune/recording-oracle/src/common/utils/environment.ts @@ -0,0 +1,25 @@ +enum EnvironmentName { + LOCAL = 'local', + DEVELOPMENT = 'development', + TEST = 'test', + STAGING = 'staging', +} + +class Environment { + static readonly name: string = + process.env.NODE_ENV || EnvironmentName.DEVELOPMENT; + + static isDevelopment(): boolean { + return [ + EnvironmentName.DEVELOPMENT, + EnvironmentName.TEST, + EnvironmentName.LOCAL, + ].includes(Environment.name as EnvironmentName); + } + + static isTest(): boolean { + return Environment.name === EnvironmentName.TEST; + } +} + +export default Environment; diff --git a/packages/apps/fortune/recording-oracle/src/common/utils/webhook.ts b/packages/apps/fortune/recording-oracle/src/common/utils/webhook.ts index f176df23e9..744b310e32 100644 --- a/packages/apps/fortune/recording-oracle/src/common/utils/webhook.ts +++ b/packages/apps/fortune/recording-oracle/src/common/utils/webhook.ts @@ -1,6 +1,7 @@ import { HttpService } from '@nestjs/axios'; -import { Logger } from '@nestjs/common'; import { firstValueFrom } from 'rxjs'; + +import logger from '../../logger'; import { WebhookDto } from '../../modules/webhook/webhook.dto'; import { HEADER_SIGNATURE_KEY } from '../constants'; import { CaseConverter } from './case-converter'; @@ -9,7 +10,6 @@ import { formatAxiosError } from './http'; export async function sendWebhook( httpService: HttpService, - logger: Logger, webhookUrl: string, webhookBody: WebhookDto, privateKey: string, @@ -25,6 +25,7 @@ export async function sendWebhook( } catch (error: any) { const formattedError = formatAxiosError(error); logger.error('Webhook not sent', { + webhookUrl, error: formattedError, }); throw new Error(formattedError.message); diff --git a/packages/apps/fortune/recording-oracle/src/logger/index.ts b/packages/apps/fortune/recording-oracle/src/logger/index.ts new file mode 100644 index 0000000000..693fc3f195 --- /dev/null +++ b/packages/apps/fortune/recording-oracle/src/logger/index.ts @@ -0,0 +1,24 @@ +import { createLogger, NestLogger, LogLevel } from '@human-protocol/logger'; + +import Environment from '../common/utils/environment'; + +const isDevelopment = Environment.isDevelopment(); + +const defaultLogger = createLogger( + { + name: 'DefaultLogger', + level: isDevelopment ? LogLevel.DEBUG : LogLevel.INFO, + pretty: isDevelopment, + disabled: Environment.isTest(), + }, + { + environment: Environment.name, + service: 'fortune-recording-oracle', + }, +); + +export const nestLoggerOverride = new NestLogger( + defaultLogger.child({ name: 'NestLogger' }), +); + +export default defaultLogger; diff --git a/packages/apps/fortune/recording-oracle/src/main.ts b/packages/apps/fortune/recording-oracle/src/main.ts index 991069853a..35d44a2f4c 100644 --- a/packages/apps/fortune/recording-oracle/src/main.ts +++ b/packages/apps/fortune/recording-oracle/src/main.ts @@ -1,17 +1,19 @@ +import { ConfigService } from '@nestjs/config'; +import { INestApplication } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { json, urlencoded } from 'body-parser'; import { useContainer } from 'class-validator'; import helmet from 'helmet'; -import { INestApplication } from '@nestjs/common'; +import logger, { nestLoggerOverride } from './logger'; import { AppModule } from './app.module'; import { ServerConfigService } from './common/config/server-config.service'; -import { ConfigService } from '@nestjs/config'; async function bootstrap() { const app = await NestFactory.create(AppModule, { cors: true, + logger: nestLoggerOverride, }); const configService: ConfigService = app.get(ConfigService); @@ -44,7 +46,7 @@ async function bootstrap() { await app.listen(port, host, async () => { // eslint-disable-next-line no-console - console.info(`API server is running on http://${host}:${port}`); + logger.info(`API server is running on http://${host}:${port}`); }); } diff --git a/packages/apps/fortune/recording-oracle/src/modules/job/job.module.ts b/packages/apps/fortune/recording-oracle/src/modules/job/job.module.ts index f8de93cf57..b41137f1f4 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/job/job.module.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/job/job.module.ts @@ -1,12 +1,12 @@ import { HttpModule } from '@nestjs/axios'; -import { Logger, Module } from '@nestjs/common'; +import { Module } from '@nestjs/common'; import { JobService } from './job.service'; import { Web3Module } from '../web3/web3.module'; import { StorageModule } from '../storage/storage.module'; @Module({ imports: [HttpModule, Web3Module, StorageModule], - providers: [Logger, JobService], + providers: [JobService], exports: [JobService], }) export class JobModule {} diff --git a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts index 10191d7f2b..439952805c 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts @@ -5,9 +5,11 @@ import { KVStoreUtils, } from '@human-protocol/sdk'; import { HttpService } from '@nestjs/axios'; -import { Inject, Injectable, Logger } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common'; import { ethers } from 'ethers'; import * as Minio from 'minio'; + +import logger from '../../logger'; import { Web3ConfigService } from '../../common/config/web3-config.service'; import { ErrorJob } from '../../common/constants/errors'; import { JobRequestType, SolutionError } from '../../common/enums/job'; @@ -26,8 +28,8 @@ import { @Injectable() export class JobService { - public readonly logger = new Logger(JobService.name); - public readonly minioClient: Minio.Client; + private readonly logger = logger.child({ context: JobService.name }); + readonly minioClient: Minio.Client; constructor( private web3ConfigService: Web3ConfigService, @@ -86,16 +88,23 @@ export class JobService { } async processJobSolution(webhook: WebhookDto): Promise { + const logger = this.logger.child({ + action: 'processJobSolution', + chainId: webhook.chainId, + escrowAddress: webhook.escrowAddress, + }); const signer = this.web3Service.getSigner(webhook.chainId); const escrowClient = await EscrowClient.build(signer); const recordingOracleAddress = await escrowClient.getRecordingOracleAddress( webhook.escrowAddress, ); - if ( - ethers.getAddress(recordingOracleAddress) !== (await signer.getAddress()) - ) { - this.logger.log(ErrorJob.AddressMismatches, JobService.name); + const signerAddress = await signer.getAddress(); + if (ethers.getAddress(recordingOracleAddress) !== signerAddress) { + logger.error(ErrorJob.AddressMismatches, { + recordingOracleAddress, + signerAddress, + }); throw new ValidationError(ErrorJob.AddressMismatches); } @@ -104,7 +113,9 @@ export class JobService { escrowStatus !== EscrowStatus.Pending && escrowStatus !== EscrowStatus.Partial ) { - this.logger.log(ErrorJob.InvalidStatus, JobService.name); + logger.error(ErrorJob.InvalidStatus, { + escrowStatus, + }); throw new ConflictError(ErrorJob.InvalidStatus); } @@ -115,12 +126,17 @@ export class JobService { await this.storageService.download(manifestUrl); if (!submissionsRequired || !requestType) { - this.logger.log(ErrorJob.InvalidManifest, JobService.name); + logger.error(ErrorJob.InvalidManifest, { + submissionsRequired, + requestType, + }); throw new ValidationError(ErrorJob.InvalidManifest); } if (requestType !== JobRequestType.FORTUNE) { - this.logger.log(ErrorJob.InvalidJobType, JobService.name); + logger.error(ErrorJob.InvalidJobType, { + requestType, + }); throw new ValidationError(ErrorJob.InvalidJobType); } @@ -135,10 +151,10 @@ export class JobService { } if (existingJobSolutions.length >= submissionsRequired) { - this.logger.log( - ErrorJob.AllSolutionsHaveAlreadyBeenSent, - JobService.name, - ); + logger.warn(ErrorJob.AllSolutionsHaveAlreadyBeenSent, { + submissionsRequired, + nExistingJobSolutions: existingJobSolutions.length, + }); throw new ConflictError(ErrorJob.AllSolutionsHaveAlreadyBeenSent); } @@ -189,7 +205,6 @@ export class JobService { if (reputationOracleWebhook) { await sendWebhook( this.httpService, - this.logger, reputationOracleWebhook, { chainId: webhook.chainId, @@ -232,7 +247,6 @@ export class JobService { await sendWebhook( this.httpService, - this.logger, exchangeOracleURL, webhookBody, this.web3ConfigService.privateKey, diff --git a/yarn.lock b/yarn.lock index 997583f217..862db0f12c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4134,6 +4134,7 @@ __metadata: resolution: "@human-protocol/fortune-exchange-oracle-server@workspace:packages/apps/fortune/exchange-oracle/server" dependencies: "@golevelup/ts-jest": "npm:^0.6.1" + "@human-protocol/logger": "workspace:*" "@human-protocol/sdk": "workspace:*" "@nestjs/axios": "npm:^3.1.2" "@nestjs/cli": "npm:^10.3.2" @@ -4193,6 +4194,7 @@ __metadata: version: 0.0.0-use.local resolution: "@human-protocol/fortune-recording-oracle@workspace:packages/apps/fortune/recording-oracle" dependencies: + "@human-protocol/logger": "workspace:*" "@human-protocol/sdk": "workspace:*" "@nestjs/axios": "npm:^3.1.2" "@nestjs/cli": "npm:^10.3.2" From 77db00a375b753782815909c0611d1665fc2794b Mon Sep 17 00:00:00 2001 From: Dmitry Nechay Date: Thu, 7 Aug 2025 13:34:29 +0300 Subject: [PATCH 09/14] [Dashboard] feat: use shared logger and cache headers (#3495) --- packages/apps/dashboard/server/.env.example | 1 + packages/apps/dashboard/server/package.json | 1 + .../apps/dashboard/server/src/app.module.ts | 8 ++- .../src/common/config/cache-factory.config.ts | 13 ++-- .../src/common/config/env-config.service.ts | 2 +- .../src/common/config/redis-config.service.ts | 12 +++- .../server/src/common/utils/environment.ts | 26 ++++++++ .../dashboard/server/src/common/utils/http.ts | 10 +++ .../apps/dashboard/server/src/logger/index.ts | 24 +++++++ packages/apps/dashboard/server/src/main.ts | 8 +-- .../src/modules/details/details.controller.ts | 10 +-- .../src/modules/details/details.service.ts | 63 ++++++++++-------- .../src/modules/details/details.spec.ts | 18 +++-- .../modules/networks/network.service.spec.ts | 13 ++-- .../modules/networks/networks.controller.ts | 8 ++- .../src/modules/networks/networks.service.ts | 15 +++-- .../src/modules/stats/stats.controller.ts | 37 ++++++----- .../server/src/modules/stats/stats.service.ts | 66 ++++++++++++------- .../src/modules/storage/storage.service.ts | 44 +++++-------- yarn.lock | 1 + 20 files changed, 239 insertions(+), 141 deletions(-) create mode 100644 packages/apps/dashboard/server/src/common/utils/environment.ts create mode 100644 packages/apps/dashboard/server/src/common/utils/http.ts create mode 100644 packages/apps/dashboard/server/src/logger/index.ts diff --git a/packages/apps/dashboard/server/.env.example b/packages/apps/dashboard/server/.env.example index 4d02bcd63d..8edb62a3e6 100644 --- a/packages/apps/dashboard/server/.env.example +++ b/packages/apps/dashboard/server/.env.example @@ -11,6 +11,7 @@ HCAPTCHA_API_KEY=replace_me # Redis REDIS_HOST=0.0.0.0 REDIS_PORT=6380 +REDIS_DB=0 # S3 S3_ENDPOINT=0.0.0.0 diff --git a/packages/apps/dashboard/server/package.json b/packages/apps/dashboard/server/package.json index 6e92cfc6a3..45b9d4ec53 100644 --- a/packages/apps/dashboard/server/package.json +++ b/packages/apps/dashboard/server/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@human-protocol/core": "workspace:*", + "@human-protocol/logger": "workspace:*", "@human-protocol/sdk": "workspace:*", "@nestjs/axios": "^3.1.2", "@nestjs/cache-manager": "^2.2.2", diff --git a/packages/apps/dashboard/server/src/app.module.ts b/packages/apps/dashboard/server/src/app.module.ts index 6a9b8b9fb1..1b8770ffff 100644 --- a/packages/apps/dashboard/server/src/app.module.ts +++ b/packages/apps/dashboard/server/src/app.module.ts @@ -1,16 +1,17 @@ import { CacheModule } from '@nestjs/cache-manager'; +import { Module } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { ScheduleModule } from '@nestjs/schedule'; -import { Module } from '@nestjs/common'; import * as Joi from 'joi'; import { AppController } from './app.controller'; import { CacheFactoryConfig } from './common/config/cache-factory.config'; import { CommonConfigModule } from './common/config/config.module'; +import Environment from './common/utils/environment'; import { DetailsModule } from './modules/details/details.module'; -import { StatsModule } from './modules/stats/stats.module'; import { NetworksModule } from './modules/networks/networks.module'; +import { StatsModule } from './modules/stats/stats.module'; @Module({ imports: [ @@ -18,13 +19,14 @@ import { NetworksModule } from './modules/networks/networks.module'; /** * First value found takes precendece */ - envFilePath: [`.env.${process.env.NODE_ENV}`, '.env.local', '.env'], + envFilePath: [`.env.${Environment.name}`, '.env.local', '.env'], isGlobal: true, validationSchema: Joi.object({ HOST: Joi.string().required(), PORT: Joi.number().port().default(3000), REDIS_HOST: Joi.string(), REDIS_PORT: Joi.number(), + REDIS_DB: Joi.number(), SUBGRAPH_API_KEY: Joi.string(), HCAPTCHA_API_KEY: Joi.string().required(), CACHE_HMT_PRICE_TTL: Joi.number(), diff --git a/packages/apps/dashboard/server/src/common/config/cache-factory.config.ts b/packages/apps/dashboard/server/src/common/config/cache-factory.config.ts index d62e2dd1f4..76ed739658 100644 --- a/packages/apps/dashboard/server/src/common/config/cache-factory.config.ts +++ b/packages/apps/dashboard/server/src/common/config/cache-factory.config.ts @@ -1,14 +1,16 @@ import { CacheModuleAsyncOptions } from '@nestjs/common/cache'; import { ConfigModule } from '@nestjs/config'; -import * as _ from 'lodash'; -import { RedisConfigService } from './redis-config.service'; import { redisStore } from 'cache-manager-redis-yet'; -import { Logger } from '@nestjs/common'; +import * as _ from 'lodash'; -const logger = new Logger('CacheFactoryRedisStore'); +import logger from '../../logger'; +import { RedisConfigService } from './redis-config.service'; const throttledRedisErrorLog = _.throttle((error) => { - logger.error('Redis client network error', error); + logger.error('Redis client network error', { + context: 'CacheFactoryRedisStore', + error, + }); }, 1000 * 5); export const CacheFactoryConfig: CacheModuleAsyncOptions = { @@ -20,6 +22,7 @@ export const CacheFactoryConfig: CacheModuleAsyncOptions = { host: configService.redisHost, port: configService.redisPort, }, + database: configService.redisDbNumber, disableOfflineQueue: true, }); 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 9946515770..b70a2831bd 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 @@ -17,7 +17,7 @@ export const DEFAULT_HCAPTCHA_STATS_ENABLED = true; export const HMT_STATS_START_DATE = '2021-04-06'; export const MINIMUM_HMT_TRANSFERS = 5; export const DEFAULT_NETWORK_USAGE_FILTER_MONTHS = 1; -export const DEFAULT_NETWORKS_OPERATING_CACHE_TTL = 2 * 60; +export const DEFAULT_NETWORKS_OPERATING_CACHE_TTL = 1 * 60; export const MINIMUM_ESCROWS_COUNT = 1; @Injectable() diff --git a/packages/apps/dashboard/server/src/common/config/redis-config.service.ts b/packages/apps/dashboard/server/src/common/config/redis-config.service.ts index be75022da2..23134eab74 100644 --- a/packages/apps/dashboard/server/src/common/config/redis-config.service.ts +++ b/packages/apps/dashboard/server/src/common/config/redis-config.service.ts @@ -13,13 +13,20 @@ export const HMT_PREFIX = 'hmt-'; @Injectable() export class RedisConfigService { - constructor(private configService: ConfigService) {} + constructor(private readonly configService: ConfigService) {} + get redisHost(): string { return this.configService.get('REDIS_HOST', DEFAULT_REDIS_HOST); } + get redisPort(): number { return this.configService.get('REDIS_PORT', DEFAULT_REDIS_PORT); } + + get redisDbNumber(): number { + return this.configService.get('REDIS_DB', 0); + } + get cacheHmtPriceTTL(): number { return ( this.configService.get( @@ -28,6 +35,7 @@ export class RedisConfigService { ) * 1000 ); } + get cacheHmtGeneralStatsTTL(): number { return ( this.configService.get( @@ -36,12 +44,14 @@ export class RedisConfigService { ) * 1000 ); } + get hmtPriceCacheKey(): string { return this.configService.get( 'HMT_PRICE_CACHE_KEY', DEFAULT_HMT_PRICE_CACHE_KEY, ); } + get hmtGeneralStatsCacheKey(): string { return this.configService.get( 'HMT_GENERAL_STATS_CACHE_KEY', diff --git a/packages/apps/dashboard/server/src/common/utils/environment.ts b/packages/apps/dashboard/server/src/common/utils/environment.ts new file mode 100644 index 0000000000..05d5c87255 --- /dev/null +++ b/packages/apps/dashboard/server/src/common/utils/environment.ts @@ -0,0 +1,26 @@ +enum EnvironmentName { + LOCAL = 'local', + DEVELOPMENT = 'development', + TEST = 'test', + STAGING = 'staging', + PRODUCTION = 'production', +} + +class Environment { + static readonly name: string = + process.env.NODE_ENV || EnvironmentName.DEVELOPMENT; + + static isDevelopment(): boolean { + return [ + EnvironmentName.DEVELOPMENT, + EnvironmentName.TEST, + EnvironmentName.LOCAL, + ].includes(Environment.name as EnvironmentName); + } + + static isTest(): boolean { + return Environment.name === EnvironmentName.TEST; + } +} + +export default Environment; diff --git a/packages/apps/dashboard/server/src/common/utils/http.ts b/packages/apps/dashboard/server/src/common/utils/http.ts new file mode 100644 index 0000000000..6c4fb2b45b --- /dev/null +++ b/packages/apps/dashboard/server/src/common/utils/http.ts @@ -0,0 +1,10 @@ +import { AxiosError } from 'axios'; + +export function formatAxiosError(error: AxiosError) { + return { + name: error.name, + stack: error.stack, + cause: error.cause, + message: error.message, + }; +} diff --git a/packages/apps/dashboard/server/src/logger/index.ts b/packages/apps/dashboard/server/src/logger/index.ts new file mode 100644 index 0000000000..e8057bf1e0 --- /dev/null +++ b/packages/apps/dashboard/server/src/logger/index.ts @@ -0,0 +1,24 @@ +import { createLogger, NestLogger, LogLevel } from '@human-protocol/logger'; + +import Environment from '../common/utils/environment'; + +const isDevelopment = Environment.isDevelopment(); + +const defaultLogger = createLogger( + { + name: 'DefaultLogger', + level: isDevelopment ? LogLevel.DEBUG : LogLevel.INFO, + pretty: isDevelopment, + disabled: Environment.isTest(), + }, + { + environment: Environment.name, + service: 'human-protocol-dashboard', + }, +); + +export const nestLoggerOverride = new NestLogger( + defaultLogger.child({ name: 'NestLogger' }), +); + +export default defaultLogger; diff --git a/packages/apps/dashboard/server/src/main.ts b/packages/apps/dashboard/server/src/main.ts index d4bc1caa55..f27b013913 100644 --- a/packages/apps/dashboard/server/src/main.ts +++ b/packages/apps/dashboard/server/src/main.ts @@ -4,13 +4,11 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { AppModule } from './app.module'; import { EnvironmentConfigService } from './common/config/env-config.service'; +import logger, { nestLoggerOverride } from './logger'; async function bootstrap() { const app = await NestFactory.create(AppModule, { - logger: - process.env.NODE_ENV === 'development' - ? ['log', 'debug', 'error', 'verbose', 'warn'] - : ['log', 'error', 'warn'], + logger: nestLoggerOverride, }); const configService: ConfigService = app.get(ConfigService); @@ -35,7 +33,7 @@ async function bootstrap() { const port = envConfigService.port; await app.listen(port, host, async () => { - console.info(`Dashboard server is running on http://${host}:${port}`); + logger.info(`Dashboard server is running on http://${host}:${port}`); }); } bootstrap(); 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 af15c4916d..af22967f04 100644 --- a/packages/apps/dashboard/server/src/modules/details/details.controller.ts +++ b/packages/apps/dashboard/server/src/modules/details/details.controller.ts @@ -45,7 +45,7 @@ export class DetailsController { type: OperatorDto, isArray: true, }) - public async operators( + async operators( @Query() query: OperatorsPaginationDto, ): Promise { return this.detailsService.getOperators(query.chainId, { @@ -67,7 +67,7 @@ export class DetailsController { description: 'Details retrieved successfully', type: DetailsResponseDto, }) - public async details( + async details( @Param('address', AddressValidationPipe) address: string, @Query('chainId') chainId: ChainId, ): Promise { @@ -104,7 +104,7 @@ export class DetailsController { description: 'Transactions retrieved successfully', type: DetailsPaginationResponseDto, }) - public async transactions( + async transactions( @Param('address', AddressValidationPipe) address: string, @Query() query: DetailsTransactionsPaginationDto, ): Promise { @@ -138,7 +138,7 @@ export class DetailsController { description: 'Escrows retrieved successfully', type: DetailsPaginationResponseDto, }) - public async escrows( + async escrows( @Param('address', AddressValidationPipe) address: string, @Query() query: DetailsEscrowsPaginationDto, ): Promise { @@ -174,7 +174,7 @@ export class DetailsController { type: KVStoreDataDto, isArray: true, }) - public async KVStore( + async KVStore( @Param('address', AddressValidationPipe) address: string, @Query('chain_id') chainId: ChainId, ): Promise { 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 1be4efe63b..3fa5945529 100644 --- a/packages/apps/dashboard/server/src/modules/details/details.service.ts +++ b/packages/apps/dashboard/server/src/modules/details/details.service.ts @@ -1,49 +1,47 @@ -import { plainToInstance } from 'class-transformer'; -import { - BadRequestException, - Injectable, - Logger, - Inject, -} from '@nestjs/common'; -import { Cache, CACHE_MANAGER } from '@nestjs/cache-manager'; import { ChainId, EscrowUtils, - TransactionUtils, - OperatorUtils, IEscrowsFilter, - Role, + IOperatorsFilter, + KVStoreUtils, NETWORKS, + OperatorUtils, OrderDirection, - KVStoreUtils, - IOperatorsFilter, + Role, StakingClient, + TransactionUtils, WorkerUtils, } from '@human-protocol/sdk'; +import { Cache, CACHE_MANAGER } from '@nestjs/cache-manager'; +import { BadRequestException, Inject, Injectable } from '@nestjs/common'; +import { plainToInstance } from 'class-transformer'; -import { WalletDto } from './dto/wallet.dto'; -import { EscrowDto, EscrowPaginationDto } from './dto/escrow.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'; -import { firstValueFrom } from 'rxjs'; import { HMToken__factory } from '@human-protocol/core/typechain-types'; +import { HttpService } from '@nestjs/axios'; import { ethers } from 'ethers'; +import { firstValueFrom } from 'rxjs'; +import { GetOperatorsPaginationOptions } from '../../common/types'; +import { EnvironmentConfigService } from '../../common/config/env-config.service'; import { NetworkConfigService } from '../../common/config/network-config.service'; -import { OperatorsOrderBy } from '../../common/enums/operator'; -import { ReputationLevel } from '../../common/enums/reputation'; import { MAX_LEADERS_COUNT, MIN_AMOUNT_STAKED, REPUTATION_PLACEHOLDER, } from '../../common/constants/operator'; -import { GetOperatorsPaginationOptions } from 'src/common/types'; +import * as httpUtils from '../../common/utils/http'; +import { OperatorsOrderBy } from '../../common/enums/operator'; +import { ReputationLevel } from '../../common/enums/reputation'; +import logger from '../../logger'; import { KVStoreDataDto } from './dto/details-response.dto'; +import { EscrowDto, EscrowPaginationDto } from './dto/escrow.dto'; +import { OperatorDto } from './dto/operator.dto'; +import { TransactionPaginationDto } from './dto/transaction.dto'; +import { WalletDto } from './dto/wallet.dto'; @Injectable() export class DetailsService { - private readonly logger = new Logger(DetailsService.name); + private readonly logger = logger.child({ context: DetailsService.name }); + constructor( @Inject(CACHE_MANAGER) private readonly cacheManager: Cache, private readonly configService: EnvironmentConfigService, @@ -328,7 +326,12 @@ export class DetailsService { } return { address, reputation }; } catch (error) { - this.logger.error('Error fetching reputation:', error); + this.logger.error('Error fetching operator reputation', { + chainId, + address, + role, + error: httpUtils.formatAxiosError(error), + }); return { address, reputation: REPUTATION_PLACEHOLDER }; } } @@ -364,10 +367,12 @@ export class DetailsService { ); return response.data; } catch (error) { - this.logger.error( - `Error fetching reputations for chain id ${chainId}`, - error, - ); + this.logger.error('Error fetching reputations for chain', { + chainId, + orderBy, + orderDirection, + error: httpUtils.formatAxiosError(error), + }); return []; } } 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 8fdfdc2b5f..182b93091a 100644 --- a/packages/apps/dashboard/server/src/modules/details/details.spec.ts +++ b/packages/apps/dashboard/server/src/modules/details/details.spec.ts @@ -1,19 +1,18 @@ -import { Test, TestingModule } from '@nestjs/testing'; -import { DetailsService } from './details.service'; -import { HttpService } from '@nestjs/axios'; -import { EnvironmentConfigService } from '../../common/config/env-config.service'; -import { NetworkConfigService } from '../../common/config/network-config.service'; -import { Logger } from '@nestjs/common'; -import { of, throwError } from 'rxjs'; import { ChainId, IOperator, - OperatorUtils, KVStoreUtils, + OperatorUtils, OrderDirection, } from '@human-protocol/sdk'; -import { OperatorsOrderBy } from '../../common/enums/operator'; +import { HttpService } from '@nestjs/axios'; import { CACHE_MANAGER } from '@nestjs/cache-manager'; +import { Test, TestingModule } from '@nestjs/testing'; +import { of, throwError } from 'rxjs'; +import { EnvironmentConfigService } from '../../common/config/env-config.service'; +import { NetworkConfigService } from '../../common/config/network-config.service'; +import { OperatorsOrderBy } from '../../common/enums/operator'; +import { DetailsService } from './details.service'; jest.mock('@human-protocol/sdk', () => ({ ...jest.requireActual('@human-protocol/sdk'), @@ -65,7 +64,6 @@ describe('DetailsService', () => { set: jest.fn(), }, }, - Logger, ], }).compile(); diff --git a/packages/apps/dashboard/server/src/modules/networks/network.service.spec.ts b/packages/apps/dashboard/server/src/modules/networks/network.service.spec.ts index 3e01deebb2..bc3f04e0cd 100644 --- a/packages/apps/dashboard/server/src/modules/networks/network.service.spec.ts +++ b/packages/apps/dashboard/server/src/modules/networks/network.service.spec.ts @@ -1,15 +1,13 @@ import { createMock } from '@golevelup/ts-jest'; -import { Test, TestingModule } from '@nestjs/testing'; +import { ChainId, NETWORKS, StatisticsClient } from '@human-protocol/sdk'; +import { HttpService } from '@nestjs/axios'; import { CACHE_MANAGER } from '@nestjs/cache-manager'; +import { ConfigService } from '@nestjs/config'; +import { Test, TestingModule } from '@nestjs/testing'; import { Cache } from 'cache-manager'; -import { Logger } from '@nestjs/common'; -import { StatisticsClient } from '@human-protocol/sdk'; import { EnvironmentConfigService } from '../../common/config/env-config.service'; -import { ChainId, NETWORKS } from '@human-protocol/sdk'; -import { HttpService } from '@nestjs/axios'; -import { ConfigService } from '@nestjs/config'; -import { NetworksService } from './networks.service'; import { NetworkConfigService } from '../../common/config/network-config.service'; +import { NetworksService } from './networks.service'; jest.mock('@human-protocol/sdk', () => ({ ...jest.requireActual('@human-protocol/sdk'), @@ -49,7 +47,6 @@ describe('NetworksService', () => { }, NetworkConfigService, ConfigService, - Logger, ], }).compile(); diff --git a/packages/apps/dashboard/server/src/modules/networks/networks.controller.ts b/packages/apps/dashboard/server/src/modules/networks/networks.controller.ts index b0802edb7d..a5ad3a7c5b 100644 --- a/packages/apps/dashboard/server/src/modules/networks/networks.controller.ts +++ b/packages/apps/dashboard/server/src/modules/networks/networks.controller.ts @@ -2,6 +2,7 @@ import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger'; import { Controller, Get, + Header, HttpCode, UsePipes, ValidationPipe, @@ -15,8 +16,6 @@ import { ChainId } from '@human-protocol/sdk'; export class NetworksController { constructor(private readonly networksService: NetworksService) {} - @Get('/operating') - @HttpCode(200) @ApiOperation({ summary: 'Get recently used networks', description: 'Endpoint to return networks filtered by recent activity.', @@ -26,7 +25,10 @@ export class NetworksController { description: 'Networks retrieved successfully', type: Array, }) - public async getOperatingNetworks(): Promise { + @Header('Cache-Control', 'public, max-age=3600') + @HttpCode(200) + @Get('/operating') + async getOperatingNetworks(): Promise { return this.networksService.getOperatingNetworks(); } } diff --git a/packages/apps/dashboard/server/src/modules/networks/networks.service.ts b/packages/apps/dashboard/server/src/modules/networks/networks.service.ts index 26e9fbeab2..822be223c0 100644 --- a/packages/apps/dashboard/server/src/modules/networks/networks.service.ts +++ b/packages/apps/dashboard/server/src/modules/networks/networks.service.ts @@ -1,18 +1,20 @@ -import { Inject, Injectable, Logger } from '@nestjs/common'; import { ChainId, NETWORKS, StatisticsClient } from '@human-protocol/sdk'; import { Cache, CACHE_MANAGER } from '@nestjs/cache-manager'; +import { Inject, Injectable } from '@nestjs/common'; import { EnvironmentConfigService, MINIMUM_ESCROWS_COUNT, MINIMUM_HMT_TRANSFERS, } from '../../common/config/env-config.service'; -import { OPERATING_NETWORKS_CACHE_KEY } from '../../common/config/redis-config.service'; import { NetworkConfigService } from '../../common/config/network-config.service'; +import { OPERATING_NETWORKS_CACHE_KEY } from '../../common/config/redis-config.service'; +import logger from '../../logger'; @Injectable() export class NetworksService { - private readonly logger = new Logger(NetworksService.name); + private readonly logger = logger.child({ context: NetworksService.name }); + constructor( @Inject(CACHE_MANAGER) private cacheManager: Cache, private readonly envConfigService: EnvironmentConfigService, @@ -68,9 +70,10 @@ export class NetworksService { availableNetworks.push(network.chainId); } } catch (error) { - this.logger.error( - `Error processing network ${network.chainId}: ${error.message}`, - ); + this.logger.error('Error while checking network stats', { + error, + chainId: network.chainId, + }); } } diff --git a/packages/apps/dashboard/server/src/modules/stats/stats.controller.ts b/packages/apps/dashboard/server/src/modules/stats/stats.controller.ts index 22fafe4c88..730b10b814 100644 --- a/packages/apps/dashboard/server/src/modules/stats/stats.controller.ts +++ b/packages/apps/dashboard/server/src/modules/stats/stats.controller.ts @@ -1,5 +1,5 @@ import { ApiOperation, ApiResponse, ApiTags, ApiQuery } from '@nestjs/swagger'; -import { Controller, Get, HttpCode, Query } from '@nestjs/common'; +import { Controller, Get, Header, HttpCode, Query } from '@nestjs/common'; import { StatsService } from './stats.service'; import { HmtPriceDto } from './dto/hmt-price.dto'; @@ -16,8 +16,6 @@ import { HmtGeneralStatsDto } from './dto/hmt-general-stats.dto'; export class StatsController { constructor(private readonly statsService: StatsService) {} - @Get('/hmt-price') - @HttpCode(200) @ApiOperation({ summary: 'Get current HMT price', description: 'Endpoint to return a current HMT price.', @@ -27,13 +25,14 @@ export class StatsController { description: 'Price retrieved successfully', type: HmtPriceDto, }) - public async hmtPrice(): Promise { + @Header('Cache-Control', 'public, max-age=60') + @Get('/hmt-price') + @HttpCode(200) + async hmtPrice(): Promise { const hmtPrice = await this.statsService.hmtPrice(); return { hmtPrice }; } - @Get('/hcaptcha/daily') - @HttpCode(200) @ApiOperation({ summary: 'Get Hcaptcha stats', description: 'Endpoint to return Hcaptcha stats.', @@ -55,7 +54,10 @@ export class StatsController { description: 'Stats retrieved successfully', type: HcaptchaDailyStatsResponseDto, }) - public async hcaptchaDailyStats( + @Header('Cache-Control', 'public, max-age=600') + @HttpCode(200) + @Get('/hcaptcha/daily') + async hcaptchaDailyStats( @Query('from', DateValidationPipe) from: string, @Query('to', DateValidationPipe) to: string, ): Promise { @@ -63,8 +65,6 @@ export class StatsController { return { from, to, results }; } - @Get('/hcaptcha/general') - @HttpCode(200) @ApiOperation({ summary: 'Get Hcaptcha general stats', description: 'Endpoint to return Hcaptcha general stats.', @@ -74,14 +74,15 @@ export class StatsController { description: 'Stats retrieved successfully', type: HcaptchaStats, }) - public async hcaptchaGeneralStats(): Promise { + @Header('Cache-Control', 'public, max-age=600') + @HttpCode(200) + @Get('/hcaptcha/general') + async hcaptchaGeneralStats(): Promise { const result: HcaptchaStats = await this.statsService.hCaptchaGeneralStats(); return result; } - @Get('/general') - @HttpCode(200) @ApiOperation({ summary: 'Get HMT general stats', description: 'Endpoint to return HMT general stats.', @@ -91,14 +92,15 @@ export class StatsController { description: 'General stats retrieved successfully', type: HmtGeneralStatsDto, }) - public async hmtGeneral(): Promise { + @Header('Cache-Control', 'public, max-age=600') + @HttpCode(200) + @Get('/general') + async hmtGeneral(): Promise { const results: HmtGeneralStatsDto = await this.statsService.hmtGeneralStats(); return results; } - @Get('/hmt/daily') - @HttpCode(200) @ApiOperation({ summary: 'Get HMT stats', description: 'Endpoint to return HMT stats.', @@ -120,7 +122,10 @@ export class StatsController { description: 'Stats retrieved successfully', type: HmtDailyStatsResponseDto, }) - public async hmtDailyStats( + @Header('Cache-Control', 'public, max-age=600') + @HttpCode(200) + @Get('/hmt/daily') + async hmtDailyStats( @Query('from', DateValidationPipe) from: string, @Query('to', DateValidationPipe) to: string, ): Promise { diff --git a/packages/apps/dashboard/server/src/modules/stats/stats.service.ts b/packages/apps/dashboard/server/src/modules/stats/stats.service.ts index c40076db3b..763724341e 100644 --- a/packages/apps/dashboard/server/src/modules/stats/stats.service.ts +++ b/packages/apps/dashboard/server/src/modules/stats/stats.service.ts @@ -1,13 +1,16 @@ -import { Inject, Injectable, Logger, OnModuleInit } from '@nestjs/common'; +import { NETWORKS, StatisticsClient } from '@human-protocol/sdk'; +import { DailyHMTData } from '@human-protocol/sdk/dist/graphql'; import { HttpService } from '@nestjs/axios'; -import { lastValueFrom } from 'rxjs'; -import dayjs from 'dayjs'; -import { Cron } from '@nestjs/schedule'; import { Cache, CACHE_MANAGER } from '@nestjs/cache-manager'; -import { NETWORKS, StatisticsClient } from '@human-protocol/sdk'; +import { Inject, Injectable, OnModuleInit } from '@nestjs/common'; +import { Cron, SchedulerRegistry } from '@nestjs/schedule'; +import { CronJob } from 'cron'; +import dayjs from 'dayjs'; +import { lastValueFrom } from 'rxjs'; import { EnvironmentConfigService, HCAPTCHA_STATS_API_START_DATE, + HCAPTCHA_STATS_START_DATE, HMT_STATS_START_DATE, } from '../../common/config/env-config.service'; import { @@ -15,20 +18,23 @@ import { HMT_PREFIX, RedisConfigService, } from '../../common/config/redis-config.service'; -import { HCAPTCHA_STATS_START_DATE } from '../../common/config/env-config.service'; +import logger from '../../logger'; +import { NetworksService } from '../networks/networks.service'; +import { StorageService } from '../storage/storage.service'; import { HcaptchaDailyStats, HcaptchaStats } from './dto/hcaptcha.dto'; import { HmtGeneralStatsDto } from './dto/hmt-general-stats.dto'; -import { DailyHMTData } from '@human-protocol/sdk/dist/graphql'; -import { CachedHMTData } from './stats.interface'; import { HmtDailyStatsData } from './dto/hmt.dto'; -import { StorageService } from '../storage/storage.service'; -import { CronJob } from 'cron'; -import { SchedulerRegistry } from '@nestjs/schedule'; -import { NetworksService } from '../networks/networks.service'; +import { CachedHMTData } from './stats.interface'; + +type HcaptchaDailyStat = { + solved: number; + served?: number; +}; @Injectable() export class StatsService implements OnModuleInit { - private readonly logger = new Logger(StatsService.name); + private readonly logger = logger.child({ context: StatsService.name }); + constructor( @Inject(CACHE_MANAGER) private cacheManager: Cache, private readonly redisConfigService: RedisConfigService, @@ -36,7 +42,7 @@ export class StatsService implements OnModuleInit { private readonly envConfigService: EnvironmentConfigService, private readonly httpService: HttpService, private readonly storageService: StorageService, - private schedulerRegistry: SchedulerRegistry, + private readonly schedulerRegistry: SchedulerRegistry, ) { if (this.envConfigService.hCaptchaStatsEnabled === true) { const job = new CronJob('*/15 * * * *', () => { @@ -75,8 +81,12 @@ export class StatsService implements OnModuleInit { } private async fetchHistoricalHcaptchaStats(): Promise { - this.logger.log('Fetching historical hCaptcha stats.'); let startDate = dayjs(HCAPTCHA_STATS_API_START_DATE); + + this.logger.info('Fetching historical hCaptcha stats', { + startDate, + }); + const currentDate = dayjs(); const dates = []; @@ -89,9 +99,17 @@ export class StatsService implements OnModuleInit { startDate = startDate.add(1, 'month'); } - const results = await this.storageService.downloadFile( - this.envConfigService.hCaptchaStatsFile, - ); + let hCaptchaStats: HcaptchaDailyStat[][]; + + try { + const statsFile = await this.storageService.downloadFile( + this.envConfigService.hCaptchaStatsFile, + ); + hCaptchaStats = JSON.parse(statsFile.toString()); + } catch (error) { + this.logger.error('Error while getting hCaptcha stats file', error); + hCaptchaStats = []; + } for (const range of dates) { const { data } = await lastValueFrom( @@ -103,11 +121,11 @@ export class StatsService implements OnModuleInit { }, }), ); - results.push(data); + hCaptchaStats.push(data); } - for (const monthData of results) { - for (const [date, value] of Object.entries(monthData)) { + for (const monthData of hCaptchaStats) { + for (const [date, value] of Object.entries(monthData)) { const multiplier = date <= '2022-11-30' ? 18 : 9; if (value.served) delete value.served; value.solved *= multiplier; @@ -132,11 +150,12 @@ export class StatsService implements OnModuleInit { } async fetchTodayHcaptchaStats() { - this.logger.log('Fetching hCaptcha stats for today.'); const today = dayjs().format('YYYY-MM-DD'); const from = today; const to = today; + this.logger.info('Fetching hCaptcha stats for today', { from, to }); + const { data } = await lastValueFrom( this.httpService.get(this.envConfigService.hCaptchaStatsSource, { params: { @@ -188,7 +207,8 @@ export class StatsService implements OnModuleInit { @Cron('*/15 * * * *') async fetchHmtGeneralStats() { - this.logger.log('Fetching HMT general stats across multiple networks.'); + this.logger.info('Fetching HMT general stats across multiple networks'); + const aggregatedStats: HmtGeneralStatsDto = { totalHolders: 0, totalTransactions: 0, diff --git a/packages/apps/dashboard/server/src/modules/storage/storage.service.ts b/packages/apps/dashboard/server/src/modules/storage/storage.service.ts index 5cb3f09d83..cd618edd3f 100644 --- a/packages/apps/dashboard/server/src/modules/storage/storage.service.ts +++ b/packages/apps/dashboard/server/src/modules/storage/storage.service.ts @@ -1,12 +1,13 @@ -import { Injectable, Logger, NotFoundException } from '@nestjs/common'; +import { Injectable, NotFoundException } from '@nestjs/common'; import * as Minio from 'minio'; import { S3ConfigService } from '../../common/config/s3-config.service'; -import { Readable } from 'stream'; +import logger from '../../logger'; @Injectable() export class StorageService { - private readonly logger = new Logger(StorageService.name); - public readonly minioClient: Minio.Client; + private readonly logger = logger.child({ context: StorageService.name }); + + readonly minioClient: Minio.Client; constructor(private s3ConfigService: S3ConfigService) { this.minioClient = new Minio.Client({ @@ -18,7 +19,7 @@ export class StorageService { }); } - public async downloadFile(key: string): Promise { + async downloadFile(key: string): Promise { try { const isBucketExists = await this.minioClient.bucketExists( this.s3ConfigService.bucket, @@ -27,33 +28,24 @@ export class StorageService { throw new NotFoundException('Bucket not found'); } - const response: Readable = await this.minioClient.getObject( + const fileStream = await this.minioClient.getObject( this.s3ConfigService.bucket, key, ); - const chunks: any[] = []; - return new Promise((resolve, reject) => { - response.on('data', (chunk) => { - chunks.push(chunk); - }); - - response.on('end', () => { - const fileContent = Buffer.concat(chunks).toString(); - try { - resolve(JSON.parse(fileContent || '')); - } catch (error) { - reject(new Error('Error parsing JSON')); - } - }); + const chunks: Buffer[] = []; + for await (const chunk of fileStream) { + chunks.push(Buffer.from(chunk)); + } - response.on('error', (err) => { - reject(err); - }); + return Buffer.concat(chunks); + } catch (error) { + const message = 'Failed to download file'; + this.logger.error(message, { + key, + error, }); - } catch (e) { - this.logger.log(e); - return []; + throw new Error(message); } } } diff --git a/yarn.lock b/yarn.lock index 862db0f12c..a8d8c1a0a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4002,6 +4002,7 @@ __metadata: resolution: "@human-protocol/dashboard-server@workspace:packages/apps/dashboard/server" dependencies: "@human-protocol/core": "workspace:*" + "@human-protocol/logger": "workspace:*" "@human-protocol/sdk": "workspace:*" "@nestjs/axios": "npm:^3.1.2" "@nestjs/cache-manager": "npm:^2.2.2" From df72826f69503b5858a87e7e83a8f47f47a9bf43 Mon Sep 17 00:00:00 2001 From: Dmitry Nechay Date: Thu, 7 Aug 2025 18:45:18 +0300 Subject: [PATCH 10/14] [HUMAN App] feat: use shared logger lib (#3496) --- .../src/common/exceptions/exception.filter.ts | 2 + .../src/common/exceptions/exception.filter.ts | 2 + packages/apps/human-app/server/Dockerfile | 1 + packages/apps/human-app/server/package.json | 1 + .../apps/human-app/server/src/app.module.ts | 21 ++++- .../src/common/config/cache-factory.config.ts | 12 +-- .../common/config/gateway-config.service.ts | 2 + ...ilter.spec.ts => exception.filter.spec.ts} | 11 +-- ...eptions.filter.ts => exceptions.filter.ts} | 29 ++++--- .../interceptors/axios-request.interceptor.ts | 38 ++++---- .../server/src/common/utils/environment.ts | 30 +++++++ .../human-app/server/src/common/utils/http.ts | 10 +++ .../exchange-oracle.gateway.ts | 56 ++++++------ .../h-captcha-labeling.module.ts | 7 +- .../h-captcha-statistics.gateway.ts | 6 +- .../h-captcha-verify.gateway.ts | 54 ++++++------ .../spec/h-captcha-labeling.gateways.spec.ts | 39 --------- .../spec/h-captcha-verify-gateway.spec.ts | 74 ++++++++++++++++ .../server/src/logger/__mocks__/index.ts | 11 +++ .../apps/human-app/server/src/logger/index.ts | 24 ++++++ packages/apps/human-app/server/src/main.ts | 29 +++---- .../src/modules/cron-job/cron-job.service.ts | 46 ++++++---- .../cron-job/spec/cron-job.service.spec.ts | 9 +- .../modules/h-captcha/h-captcha.controller.ts | 16 +++- .../modules/h-captcha/h-captcha.service.ts | 80 +++++++++-------- .../h-captcha/spec/h-captcha.fixtures.ts | 9 +- .../h-captcha/spec/h-captcha.service.spec.ts | 13 ++- .../job-assignment.controller.ts | 8 +- .../job-assignment/job-assignment.service.ts | 86 ++++++++++--------- .../oracle-discovery.controller.ts | 3 +- .../oracle-discovery.service.ts | 25 +++--- .../spec/oracle-discovery.service.spec.ts | 7 +- .../src/common/exceptions/exception.filter.ts | 2 + .../src/common/filters/exception.filter.ts | 2 + yarn.lock | 1 + 35 files changed, 468 insertions(+), 298 deletions(-) rename packages/apps/human-app/server/src/common/filter/{global-exception.filter.spec.ts => exception.filter.spec.ts} (86%) rename packages/apps/human-app/server/src/common/filter/{global-exceptions.filter.ts => exceptions.filter.ts} (57%) create mode 100644 packages/apps/human-app/server/src/common/utils/environment.ts create mode 100644 packages/apps/human-app/server/src/common/utils/http.ts create mode 100644 packages/apps/human-app/server/src/integrations/h-captcha-labeling/spec/h-captcha-verify-gateway.spec.ts create mode 100644 packages/apps/human-app/server/src/logger/__mocks__/index.ts create mode 100644 packages/apps/human-app/server/src/logger/index.ts diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts index 8ed9509ce3..bfc2d72a83 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts @@ -55,6 +55,8 @@ export class ExceptionFilter implements IExceptionFilter { this.logger.error('Unhandled exception', exception); } + response.removeHeader('Cache-Control'); + response.status(status).json({ status_code: status, timestamp: new Date().toISOString(), diff --git a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts index 5b6e36df7a..c2e2cd7a90 100644 --- a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts @@ -51,6 +51,8 @@ export class ExceptionFilter implements IExceptionFilter { this.logger.error('Unhandled exception', exception); } + response.removeHeader('Cache-Control'); + response.status(status).json({ status_code: status, timestamp: new Date().toISOString(), diff --git a/packages/apps/human-app/server/Dockerfile b/packages/apps/human-app/server/Dockerfile index c04bf24b04..c6193f2ae6 100644 --- a/packages/apps/human-app/server/Dockerfile +++ b/packages/apps/human-app/server/Dockerfile @@ -16,6 +16,7 @@ COPY ${APP_PATH}/package.json ./${APP_PATH}/ # so we need to copy and build them COPY packages/core ./packages/core COPY packages/sdk ./packages/sdk +COPY packages/libs ./packages/libs RUN yarn install diff --git a/packages/apps/human-app/server/package.json b/packages/apps/human-app/server/package.json index 393f154574..54e5696427 100644 --- a/packages/apps/human-app/server/package.json +++ b/packages/apps/human-app/server/package.json @@ -25,6 +25,7 @@ "@automapper/classes": "^8.8.1", "@automapper/core": "^8.8.1", "@automapper/nestjs": "^8.8.1", + "@human-protocol/logger": "workspace:*", "@human-protocol/sdk": "workspace:*", "@nestjs/axios": "^3.1.2", "@nestjs/cache-manager": "^2.2.1", diff --git a/packages/apps/human-app/server/src/app.module.ts b/packages/apps/human-app/server/src/app.module.ts index a693e40889..202e7d1ec1 100644 --- a/packages/apps/human-app/server/src/app.module.ts +++ b/packages/apps/human-app/server/src/app.module.ts @@ -3,18 +3,25 @@ import { AutomapperModule } from '@automapper/nestjs'; import { ChainId } from '@human-protocol/sdk'; import { HttpModule } from '@nestjs/axios'; import { CacheModule } from '@nestjs/cache-manager'; -import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; +import { + ClassSerializerInterceptor, + MiddlewareConsumer, + Module, + NestModule, +} from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; -import { APP_GUARD } from '@nestjs/core'; +import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core'; import Joi from 'joi'; import { AppController } from './app.controller'; import { CacheFactoryConfig } from './common/config/cache-factory.config'; import { CommonConfigModule } from './common/config/common-config.module'; import { EnvironmentConfigService } from './common/config/environment-config.service'; +import { ExceptionFilter } from './common/filter/exceptions.filter'; import { JwtAuthGuard } from './common/guards/jwt.auth'; import { JwtHttpStrategy } from './common/guards/strategy'; import { InterceptorModule } from './common/interceptors/interceptor.module'; import { ForbidUnauthorizedHostMiddleware } from './common/middleware/host-check.middleware'; +import Environment from './common/utils/environment'; import { EscrowUtilsModule } from './integrations/escrow/escrow-utils.module'; import { ExchangeOracleModule } from './integrations/exchange-oracle/exchange-oracle.module'; import { HCaptchaLabelingModule } from './integrations/h-captcha-labeling/h-captcha-labeling.module'; @@ -58,7 +65,7 @@ const JOI_BOOLEAN_STRING_SCHEMA = Joi.string().valid('true', 'false'); /** * First value found takes precendece */ - envFilePath: [`.env.${process.env.NODE_ENV}`, '.env.local', '.env'], + envFilePath: [`.env.${Environment.name}`, '.env.local', '.env'], isGlobal: true, validationSchema: Joi.object({ HOST: Joi.string().required(), @@ -157,6 +164,14 @@ const JOI_BOOLEAN_STRING_SCHEMA = Joi.string().valid('true', 'false'); provide: APP_GUARD, useClass: JwtAuthGuard, }, + { + provide: APP_INTERCEPTOR, + useClass: ClassSerializerInterceptor, + }, + { + provide: APP_FILTER, + useClass: ExceptionFilter, + }, ], }) export class AppModule implements NestModule { diff --git a/packages/apps/human-app/server/src/common/config/cache-factory.config.ts b/packages/apps/human-app/server/src/common/config/cache-factory.config.ts index 53b06b8793..a427d70de0 100644 --- a/packages/apps/human-app/server/src/common/config/cache-factory.config.ts +++ b/packages/apps/human-app/server/src/common/config/cache-factory.config.ts @@ -1,15 +1,15 @@ -import { Logger } from '@nestjs/common'; import { CacheModuleAsyncOptions } from '@nestjs/cache-manager'; import { ConfigModule } from '@nestjs/config'; -import _ from 'lodash'; import { redisStore } from 'cache-manager-redis-yet'; - +import _ from 'lodash'; +import logger from '../../logger'; import { EnvironmentConfigService } from './environment-config.service'; -const logger = new Logger('CacheFactoryRedisStore'); - const throttledRedisErrorLog = _.throttle((error) => { - logger.error('Redis client network error', error); + logger.error('Redis client network error', { + context: 'CacheFactoryRedisStore', + error, + }); }, 1000 * 5); export const CacheFactoryConfig: CacheModuleAsyncOptions = { diff --git a/packages/apps/human-app/server/src/common/config/gateway-config.service.ts b/packages/apps/human-app/server/src/common/config/gateway-config.service.ts index 89a86627f7..7f7c548fb2 100644 --- a/packages/apps/human-app/server/src/common/config/gateway-config.service.ts +++ b/packages/apps/human-app/server/src/common/config/gateway-config.service.ts @@ -18,6 +18,7 @@ export class GatewayConfigService { JSON_HEADER = { 'Content-Type': 'application/json', }; + constructor(private envConfig: EnvironmentConfigService) {} private getGatewaysConfig(): Gateways { @@ -181,6 +182,7 @@ export class GatewayConfigService { }, }; } + getConfig(gateway: ExternalApiName): GatewayConfig { return this.getGatewaysConfig().gateways[gateway]; } diff --git a/packages/apps/human-app/server/src/common/filter/global-exception.filter.spec.ts b/packages/apps/human-app/server/src/common/filter/exception.filter.spec.ts similarity index 86% rename from packages/apps/human-app/server/src/common/filter/global-exception.filter.spec.ts rename to packages/apps/human-app/server/src/common/filter/exception.filter.spec.ts index 5dfcb113bf..201f8c22e5 100644 --- a/packages/apps/human-app/server/src/common/filter/global-exception.filter.spec.ts +++ b/packages/apps/human-app/server/src/common/filter/exception.filter.spec.ts @@ -1,9 +1,9 @@ import { HttpException, HttpStatus } from '@nestjs/common'; -import { GlobalExceptionsFilter } from './global-exceptions.filter'; +import { ExceptionFilter } from './exceptions.filter'; import { Test, TestingModule } from '@nestjs/testing'; -describe('GlobalExceptionsFilter', () => { - let filter: GlobalExceptionsFilter; +describe('ExceptionFilter', () => { + let filter: ExceptionFilter; let mockJson: jest.Mock; let mockStatus: jest.Mock; let mockGetResponse: jest.Mock; @@ -13,15 +13,16 @@ describe('GlobalExceptionsFilter', () => { beforeEach(async () => { jest.clearAllMocks(); const module: TestingModule = await Test.createTestingModule({ - providers: [GlobalExceptionsFilter], + providers: [ExceptionFilter], }).compile(); - filter = module.get(GlobalExceptionsFilter); + filter = module.get(ExceptionFilter); mockJson = jest.fn(); mockStatus = jest.fn().mockImplementation(() => ({ json: mockJson, })); mockGetResponse = jest.fn().mockImplementation(() => ({ status: mockStatus, + removeHeader: jest.fn(), })); mockHttpArgumentsHost = jest.fn().mockImplementation(() => ({ getResponse: mockGetResponse, diff --git a/packages/apps/human-app/server/src/common/filter/global-exceptions.filter.ts b/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts similarity index 57% rename from packages/apps/human-app/server/src/common/filter/global-exceptions.filter.ts rename to packages/apps/human-app/server/src/common/filter/exceptions.filter.ts index 2993c78a23..6f61fed29a 100644 --- a/packages/apps/human-app/server/src/common/filter/global-exceptions.filter.ts +++ b/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts @@ -1,20 +1,21 @@ import { ArgumentsHost, Catch, - ExceptionFilter, + ExceptionFilter as IExceptionFilter, HttpException, HttpStatus, - Logger, } from '@nestjs/common'; +import logger from '../../logger'; +import { AxiosError } from 'axios'; +import * as httpUtils from '../utils/http'; @Catch() -export class GlobalExceptionsFilter implements ExceptionFilter { - private readonly logger = new Logger(GlobalExceptionsFilter.name); +export class ExceptionFilter implements IExceptionFilter { + private readonly logger = logger.child({ context: ExceptionFilter.name }); catch(exception: any, host: ArgumentsHost) { const ctx = host.switchToHttp(); const response = ctx.getResponse(); - const request = ctx.getRequest(); let status = HttpStatus.INTERNAL_SERVER_ERROR; let message: any = 'Internal Server Error'; @@ -27,22 +28,22 @@ export class GlobalExceptionsFilter implements ExceptionFilter { message = exception.response.data?.message || exception.response.statusText; } else { - this.logger.error( - `Exception without status code: ${JSON.stringify(exception)}`, - exception.stack, - ); + let formattedError = exception; + if (exception instanceof AxiosError) { + formattedError = httpUtils.formatAxiosError(exception); + } + this.logger.error('Unhandled exception', formattedError); } if (typeof status !== 'number' || status < 100 || status >= 600) { - this.logger.error(`Invalid status code: ${status}, defaulting to 500.`); + this.logger.error('Invalid status code in exception filter', { + status, + }); status = HttpStatus.INTERNAL_SERVER_ERROR; message = 'Internal Server Error'; } - this.logger.error( - `HTTP Status: ${status} | Error Message: ${JSON.stringify(message)} | Request URL: ${request?.url}`, - exception.stack, - ); + response.removeHeader('Cache-Control'); response.status(status).json(message); } diff --git a/packages/apps/human-app/server/src/common/interceptors/axios-request.interceptor.ts b/packages/apps/human-app/server/src/common/interceptors/axios-request.interceptor.ts index 058f64f726..7fb5adc0af 100644 --- a/packages/apps/human-app/server/src/common/interceptors/axios-request.interceptor.ts +++ b/packages/apps/human-app/server/src/common/interceptors/axios-request.interceptor.ts @@ -1,9 +1,14 @@ +import { Injectable } from '@nestjs/common'; import axios from 'axios'; -import { Injectable, Logger } from '@nestjs/common'; +import * as httpUtils from '../../common/utils/http'; +import logger from '../../logger'; + // This interceptor injection is guarded via IS_AXIOS_REQUEST_LOGGING_ENABLED environment variable. @Injectable() export class AxiosRequestInterceptor { - private readonly logger = new Logger(AxiosRequestInterceptor.name); + private readonly logger = logger.child({ + context: AxiosRequestInterceptor.name, + }); constructor() { this.initializeRequestInterceptor(); @@ -12,23 +17,20 @@ export class AxiosRequestInterceptor { private initializeRequestInterceptor() { axios.interceptors.request.use( (config) => { - const { url, method, params, data, headers } = config; - const message = JSON.stringify( - { - request_url: url, - method: method, - params: params ?? {}, - body: data ?? {}, - headers: headers ?? {}, - }, - null, - 2, - ); - this.logger.debug(`Outgoing request:\n${message}`); + const { url, method, params, data } = config; + + this.logger.debug('Outgoing request info', { + url, + method, + params, + data, + }); return config; }, (error) => { - this.logger.error(`Request error: ${error.message}`); + this.logger.error('Request error', { + error: httpUtils.formatAxiosError(error), + }); return Promise.reject(error); }, ); @@ -36,7 +38,9 @@ export class AxiosRequestInterceptor { axios.interceptors.response.use( (response) => response, (error) => { - this.logger.error(`Response error: ${error.message}`); + this.logger.error('Response error', { + error: httpUtils.formatAxiosError(error), + }); return Promise.reject(error); }, ); diff --git a/packages/apps/human-app/server/src/common/utils/environment.ts b/packages/apps/human-app/server/src/common/utils/environment.ts new file mode 100644 index 0000000000..e7a924059a --- /dev/null +++ b/packages/apps/human-app/server/src/common/utils/environment.ts @@ -0,0 +1,30 @@ +enum EnvironmentName { + LOCAL = 'local', + DEVELOPMENT = 'development', + TEST = 'test', + STAGING = 'staging', + PRODUCTION = 'production', +} + +class Environment { + static readonly name: string = + process.env.NODE_ENV || EnvironmentName.DEVELOPMENT; + + static isDevelopment(): boolean { + return [ + EnvironmentName.DEVELOPMENT, + EnvironmentName.TEST, + EnvironmentName.LOCAL, + ].includes(Environment.name as EnvironmentName); + } + + static isProduction(): boolean { + return Environment.name === EnvironmentName.PRODUCTION; + } + + static isTest(): boolean { + return Environment.name === EnvironmentName.TEST; + } +} + +export default Environment; diff --git a/packages/apps/human-app/server/src/common/utils/http.ts b/packages/apps/human-app/server/src/common/utils/http.ts new file mode 100644 index 0000000000..6c4fb2b45b --- /dev/null +++ b/packages/apps/human-app/server/src/common/utils/http.ts @@ -0,0 +1,10 @@ +import { AxiosError } from 'axios'; + +export function formatAxiosError(error: AxiosError) { + return { + name: error.name, + stack: error.stack, + cause: error.cause, + message: error.message, + }; +} diff --git a/packages/apps/human-app/server/src/integrations/exchange-oracle/exchange-oracle.gateway.ts b/packages/apps/human-app/server/src/integrations/exchange-oracle/exchange-oracle.gateway.ts index df6e6c38db..3654e3a3bf 100644 --- a/packages/apps/human-app/server/src/integrations/exchange-oracle/exchange-oracle.gateway.ts +++ b/packages/apps/human-app/server/src/integrations/exchange-oracle/exchange-oracle.gateway.ts @@ -1,15 +1,13 @@ -import { Injectable, Logger } from '@nestjs/common'; +import { Mapper } from '@automapper/core'; +import { InjectMapper } from '@automapper/nestjs'; +import { HttpService } from '@nestjs/axios'; +import { Injectable } from '@nestjs/common'; import { AxiosRequestConfig } from 'axios'; import { lastValueFrom } from 'rxjs'; -import { - UserStatisticsCommand, - UserStatisticsResponse, -} from '../../modules/statistics/model/user-statistics.model'; -import { HttpService } from '@nestjs/axios'; -import { - OracleStatisticsCommand, - OracleStatisticsResponse, -} from '../../modules/statistics/model/oracle-statistics.model'; +import { HttpMethod } from '../../common/enums/http-method'; +import { toCleanObjParams } from '../../common/utils/gateway-common.utils'; +import * as httpUtils from '../../common/utils/http'; +import logger from '../../logger'; import { JobAssignmentCommand, JobAssignmentData, @@ -28,38 +26,48 @@ import { JobsDiscoveryParamsData, JobsDiscoveryResponse, } from '../../modules/jobs-discovery/model/jobs-discovery.model'; -import { Mapper } from '@automapper/core'; -import { InjectMapper } from '@automapper/nestjs'; -import { HttpMethod } from '../../common/enums/http-method'; -import { toCleanObjParams } from '../../common/utils/gateway-common.utils'; -import { KvStoreGateway } from '../kv-store/kv-store.gateway'; -import { EscrowUtilsGateway } from '../escrow/escrow-utils-gateway.service'; +import { + OracleStatisticsCommand, + OracleStatisticsResponse, +} from '../../modules/statistics/model/oracle-statistics.model'; +import { + UserStatisticsCommand, + UserStatisticsResponse, +} from '../../modules/statistics/model/user-statistics.model'; import { RegistrationInExchangeOracleCommand, RegistrationInExchangeOracleData, } from '../../modules/user-worker/model/worker-registration.model'; +import { EscrowUtilsGateway } from '../escrow/escrow-utils-gateway.service'; +import { KvStoreGateway } from '../kv-store/kv-store.gateway'; @Injectable() export class ExchangeOracleGateway { - logger = new Logger(ExchangeOracleGateway.name); + private readonly logger = logger.child({ + context: ExchangeOracleGateway.name, + }); constructor( - private httpService: HttpService, - private kvStoreGateway: KvStoreGateway, + private readonly httpService: HttpService, + private readonly kvStoreGateway: KvStoreGateway, private readonly escrowUtilsGateway: EscrowUtilsGateway, @InjectMapper() private mapper: Mapper, ) {} + private async callExternalHttpUtilRequest( options: AxiosRequestConfig, ): Promise { try { const response = await lastValueFrom(this.httpService.request(options)); return response.data as T; - } catch (e) { - this.logger.error( - `Error, while executing exchange oracle API call to ${options.url}, error details: ${e.message}`, - ); - throw e; + } catch (error) { + this.logger.error('Error while executing exchange oracle API call', { + url: options.url, + method: options.method, + data: options.data, + error: httpUtils.formatAxiosError(error), + }); + throw error; } } diff --git a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-labeling.module.ts b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-labeling.module.ts index 341a91aa42..be9851e209 100644 --- a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-labeling.module.ts +++ b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-labeling.module.ts @@ -1,16 +1,11 @@ import { Module } from '@nestjs/common'; import { HttpModule } from '@nestjs/axios'; import { HCaptchaStatisticsGateway } from './h-captcha-statistics.gateway'; -import { HCaptchaMapperProfile } from '../../modules/h-captcha/h-captcha.mapper.profile'; import { HCaptchaVerifyGateway } from './h-captcha-verify.gateway'; @Module({ imports: [HttpModule], - providers: [ - HCaptchaStatisticsGateway, - HCaptchaVerifyGateway, - HCaptchaMapperProfile, - ], + providers: [HCaptchaStatisticsGateway, HCaptchaVerifyGateway], exports: [HCaptchaStatisticsGateway, HCaptchaVerifyGateway], }) export class HCaptchaLabelingModule {} diff --git a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-statistics.gateway.ts b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-statistics.gateway.ts index 26c68846d6..48e47bce4b 100644 --- a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-statistics.gateway.ts +++ b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-statistics.gateway.ts @@ -20,14 +20,16 @@ import { GatewayEndpoints } from '../../common/config/gateway-config.types'; @Injectable() export class HCaptchaStatisticsGateway { private readonly gatewayConfig: GatewayConfig; + constructor( - private httpService: HttpService, + private readonly httpService: HttpService, gatewayConfigService: GatewayConfigService, ) { this.gatewayConfig = gatewayConfigService.getConfig( ExternalApiName.HCAPTCHA_LABELING_STATS, ); } + private getEndpointOptions( endpointName: GatewayEndpoints, data?: RequestDataType, @@ -49,12 +51,14 @@ export class HCaptchaStatisticsGateway { data: data, } as AxiosRequestConfig; } + private async handleRequestToHCaptchaLabelingApi( options: AxiosRequestConfig, ): Promise { const response = await lastValueFrom(this.httpService.request(options)); return response.data; } + async fetchDailyHmtSpent() { const options = this.getEndpointOptions( HCaptchaLabelingStatsEndpoints.DAILY_HMT_SPENT, diff --git a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-verify.gateway.ts b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-verify.gateway.ts index 07c79fbb42..ba4409463a 100644 --- a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-verify.gateway.ts +++ b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-verify.gateway.ts @@ -1,38 +1,41 @@ -import { Injectable, Logger } from '@nestjs/common'; +import { HttpService } from '@nestjs/axios'; +import { Injectable } from '@nestjs/common'; +import { AxiosRequestConfig } from 'axios'; +import { lastValueFrom } from 'rxjs'; +import { GatewayConfigService } from '../../common/config/gateway-config.service'; +import { GatewayEndpoints } from '../../common/config/gateway-config.types'; +import { ExternalApiName } from '../../common/enums/external-api-name'; +import { HCaptchaLabelingVerifyEndpoints } from '../../common/enums/reputation-oracle-endpoints'; import { GatewayConfig, GatewayEndpointConfig, } from '../../common/interfaces/endpoint.interface'; -import { HttpService } from '@nestjs/axios'; -import { GatewayConfigService } from '../../common/config/gateway-config.service'; -import { InjectMapper } from '@automapper/nestjs'; -import { Mapper } from '@automapper/core'; -import { ExternalApiName } from '../../common/enums/external-api-name'; -import { GatewayEndpoints } from '../../common/config/gateway-config.types'; -import { RequestDataType } from '../reputation-oracle/reputation-oracle.interface'; -import { AxiosRequestConfig } from 'axios'; -import { lastValueFrom } from 'rxjs'; +import { toCleanObjParams } from '../../common/utils/gateway-common.utils'; +import logger from '../../logger'; +import * as httpUtils from '../../common/utils/http'; import { VerifyTokenApiResponse, VerifyTokenCommand, VerifyTokenParams, } from '../../modules/h-captcha/model/verify-token.model'; -import { HCaptchaLabelingVerifyEndpoints } from '../../common/enums/reputation-oracle-endpoints'; -import { toCleanObjParams } from '../../common/utils/gateway-common.utils'; +import { RequestDataType } from '../reputation-oracle/reputation-oracle.interface'; -Injectable(); +@Injectable() export class HCaptchaVerifyGateway { private readonly gatewayConfig: GatewayConfig; - private readonly logger = new Logger(HCaptchaVerifyGateway.name); + private readonly logger = logger.child({ + context: HCaptchaVerifyGateway.name, + }); + constructor( - private httpService: HttpService, + private readonly httpService: HttpService, gatewayConfigService: GatewayConfigService, - @InjectMapper() private readonly mapper: Mapper, ) { this.gatewayConfig = gatewayConfigService.getConfig( ExternalApiName.HCAPTCHA_LABELING_VERIFY, ); } + private getEndpointOptions( endpointName: GatewayEndpoints, data?: RequestDataType, @@ -54,12 +57,7 @@ export class HCaptchaVerifyGateway { data: data, } as AxiosRequestConfig; } - private async handleRequestToHCaptchaLabelingApi( - options: AxiosRequestConfig, - ): Promise { - const response = await lastValueFrom(this.httpService.request(options)); - return response.data; - } + async sendTokenToVerify( command: VerifyTokenCommand, ): Promise { @@ -75,11 +73,15 @@ export class HCaptchaVerifyGateway { secret: command.secret, } as VerifyTokenParams; options.params = toCleanObjParams(params, options.params); - return this.handleRequestToHCaptchaLabelingApi( - options, + + const response = await lastValueFrom( + this.httpService.request(options), ); - } catch (e) { - this.logger.error('Error: ', e); + return response.data; + } catch (error) { + this.logger.error('Error while sending hCaptcha token for verification', { + error: httpUtils.formatAxiosError(error), + }); } } } diff --git a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/spec/h-captcha-labeling.gateways.spec.ts b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/spec/h-captcha-labeling.gateways.spec.ts index d1010b72da..6ac71ef280 100644 --- a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/spec/h-captcha-labeling.gateways.spec.ts +++ b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/spec/h-captcha-labeling.gateways.spec.ts @@ -1,23 +1,15 @@ import { Test, TestingModule } from '@nestjs/testing'; import { HCaptchaStatisticsGateway } from '../h-captcha-statistics.gateway'; import { HttpService } from '@nestjs/axios'; -import { AutomapperModule } from '@automapper/nestjs'; -import { classes } from '@automapper/classes'; import { of } from 'rxjs'; import { AxiosRequestConfig } from 'axios'; -import { HCaptchaVerifyMapperProfile } from '../h-captchaverify-mapper-profile.service'; import { GatewayConfigService } from '../../../common/config/gateway-config.service'; import { EnvironmentConfigService } from '../../../common/config/environment-config.service'; import { dailyHmtSpentResponseFixture, userStatsApiResponseFixture, userStatsResponseFixture, - successfulVerifyTokenApiResponseFixture, - verifyTokenCommandFixture, - verifyTokenParamsFixture, } from '../../../modules/h-captcha/spec/h-captcha.fixtures'; -import { HCaptchaVerifyGateway } from '../h-captcha-verify.gateway'; -import { toCleanObjParams } from '../../../common/utils/gateway-common.utils'; const httpServiceMock = { request: jest.fn(), @@ -32,19 +24,11 @@ const environmentConfigServiceMock = { describe('HCaptchaLabelingGateway', () => { let statisticsGateway: HCaptchaStatisticsGateway; - let verifyGateway: HCaptchaVerifyGateway; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ - imports: [ - AutomapperModule.forRoot({ - strategyInitializer: classes(), - }), - ], providers: [ HCaptchaStatisticsGateway, - HCaptchaVerifyGateway, - HCaptchaVerifyMapperProfile, GatewayConfigService, { provide: HttpService, useValue: httpServiceMock }, { @@ -57,7 +41,6 @@ describe('HCaptchaLabelingGateway', () => { statisticsGateway = module.get( HCaptchaStatisticsGateway, ); - verifyGateway = module.get(HCaptchaVerifyGateway); }); afterEach(() => { @@ -68,28 +51,6 @@ describe('HCaptchaLabelingGateway', () => { expect(statisticsGateway).toBeDefined(); }); - describe('sendTokenToVerify', () => { - it('should send token to verify successfully and verify mapping', async () => { - httpServiceMock.request.mockReturnValue( - of({ data: successfulVerifyTokenApiResponseFixture }), - ); - - const result = await verifyGateway.sendTokenToVerify( - verifyTokenCommandFixture, - ); - expect(result).toEqual(successfulVerifyTokenApiResponseFixture); - - const expectedOptions: AxiosRequestConfig = { - method: 'POST', - url: `${environmentConfigServiceMock.hcaptchaLabelingVerifyApiUrl}/siteverify`, - headers: { Authorization: verifyTokenCommandFixture.jwtToken }, - data: {}, - params: toCleanObjParams(verifyTokenParamsFixture), - }; - expect(httpServiceMock.request).toHaveBeenCalledWith(expectedOptions); - }); - }); - describe('fetchDailyHmtSpent', () => { it('should fetch daily HMT spent successfully', async () => { httpServiceMock.request.mockReturnValue( diff --git a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/spec/h-captcha-verify-gateway.spec.ts b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/spec/h-captcha-verify-gateway.spec.ts new file mode 100644 index 0000000000..1bdc1060aa --- /dev/null +++ b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/spec/h-captcha-verify-gateway.spec.ts @@ -0,0 +1,74 @@ +import { HttpService } from '@nestjs/axios'; +import { Test, TestingModule } from '@nestjs/testing'; +import { AxiosRequestConfig } from 'axios'; +import { of } from 'rxjs'; +import { EnvironmentConfigService } from '../../../common/config/environment-config.service'; +import { GatewayConfigService } from '../../../common/config/gateway-config.service'; +import { toCleanObjParams } from '../../../common/utils/gateway-common.utils'; +import { + successfulVerifyTokenApiResponseFixture, + verifyTokenCommandFixture, + verifyTokenParamsFixture, +} from '../../../modules/h-captcha/spec/h-captcha.fixtures'; +import { HCaptchaVerifyGateway } from '../h-captcha-verify.gateway'; + +const httpServiceMock = { + request: jest.fn(), +}; + +const environmentConfigServiceMock = { + hcaptchaLabelingApiKey: 'mock-api-key', + hcaptchaLabelingStatsApiUrl: 'https://api-statistics.example.com', + hcaptchaLabelingVerifyApiUrl: 'https://api-verify.example.com', + reputationOracleUrl: 'https://oracle.example.com', +}; + +describe('HCaptchaVerifyGateway', () => { + let verifyGateway: HCaptchaVerifyGateway; + + beforeAll(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [ + HCaptchaVerifyGateway, + GatewayConfigService, + { provide: HttpService, useValue: httpServiceMock }, + { + provide: EnvironmentConfigService, + useValue: environmentConfigServiceMock, + }, + ], + }).compile(); + + verifyGateway = module.get(HCaptchaVerifyGateway); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('should be defined', () => { + expect(verifyGateway).toBeDefined(); + }); + + describe('sendTokenToVerify', () => { + it('should send token to verify successfully and verify mapping', async () => { + httpServiceMock.request.mockReturnValue( + of({ data: successfulVerifyTokenApiResponseFixture }), + ); + + const result = await verifyGateway.sendTokenToVerify( + verifyTokenCommandFixture, + ); + expect(result).toEqual(successfulVerifyTokenApiResponseFixture); + + const expectedOptions: AxiosRequestConfig = { + method: 'POST', + url: `${environmentConfigServiceMock.hcaptchaLabelingVerifyApiUrl}/siteverify`, + headers: { Authorization: verifyTokenCommandFixture.jwtToken }, + data: {}, + params: toCleanObjParams(verifyTokenParamsFixture), + }; + expect(httpServiceMock.request).toHaveBeenCalledWith(expectedOptions); + }); + }); +}); diff --git a/packages/apps/human-app/server/src/logger/__mocks__/index.ts b/packages/apps/human-app/server/src/logger/__mocks__/index.ts new file mode 100644 index 0000000000..bc3cb79069 --- /dev/null +++ b/packages/apps/human-app/server/src/logger/__mocks__/index.ts @@ -0,0 +1,11 @@ +import type { Logger } from '@human-protocol/logger'; + +const logger: Logger = { + child: () => logger, + info: jest.fn(), + debug: jest.fn(), + error: jest.fn(), + warn: jest.fn(), +}; + +export default logger; diff --git a/packages/apps/human-app/server/src/logger/index.ts b/packages/apps/human-app/server/src/logger/index.ts new file mode 100644 index 0000000000..f28c991343 --- /dev/null +++ b/packages/apps/human-app/server/src/logger/index.ts @@ -0,0 +1,24 @@ +import { createLogger, NestLogger, LogLevel } from '@human-protocol/logger'; + +import Environment from '../common/utils/environment'; + +const isDevelopment = Environment.isDevelopment(); + +const defaultLogger = createLogger( + { + name: 'DefaultLogger', + level: isDevelopment ? LogLevel.DEBUG : LogLevel.INFO, + pretty: isDevelopment, + disabled: Environment.isTest(), + }, + { + environment: Environment.name, + service: 'human-app', + }, +); + +export const nestLoggerOverride = new NestLogger( + defaultLogger.child({ name: 'NestLogger' }), +); + +export default defaultLogger; diff --git a/packages/apps/human-app/server/src/main.ts b/packages/apps/human-app/server/src/main.ts index 788c74bdbc..6f1ea1f0dd 100644 --- a/packages/apps/human-app/server/src/main.ts +++ b/packages/apps/human-app/server/src/main.ts @@ -1,20 +1,18 @@ -import { NestFactory, Reflector } from '@nestjs/core'; -import { AppModule } from './app.module'; -import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; -import { ConfigService } from '@nestjs/config'; -import { - ClassSerializerInterceptor, - Logger, - ValidationPipe, -} from '@nestjs/common'; -import { EnvironmentConfigService } from './common/config/environment-config.service'; -import { GlobalExceptionsFilter } from './common/filter/global-exceptions.filter'; import { CACHE_MANAGER } from '@nestjs/cache-manager'; +import { ValidationPipe } from '@nestjs/common'; +import { ConfigService } from '@nestjs/config'; +import { NestFactory } from '@nestjs/core'; +import { NestExpressApplication } from '@nestjs/platform-express'; +import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { Cache } from 'cache-manager'; +import { AppModule } from './app.module'; +import { EnvironmentConfigService } from './common/config/environment-config.service'; +import logger, { nestLoggerOverride } from './logger'; async function bootstrap() { - const logger = new Logger(bootstrap.name); - const app = await NestFactory.create(AppModule); + const app = await NestFactory.create(AppModule, { + logger: nestLoggerOverride, + }); const configService: ConfigService = app.get(ConfigService); const envConfigService = new EnvironmentConfigService(configService); @@ -40,12 +38,11 @@ async function bootstrap() { const cacheManager: Cache = app.get(CACHE_MANAGER); await cacheManager.reset(); } - app.useGlobalFilters(new GlobalExceptionsFilter()); - app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector))); + app.useGlobalPipes(new ValidationPipe({ transform: true })); await app.listen(port, host, async () => { - logger.log(`Human APP server is running on http://${host}:${port}`); + logger.info(`Human APP server is running on http://${host}:${port}`); }); } bootstrap(); diff --git a/packages/apps/human-app/server/src/modules/cron-job/cron-job.service.ts b/packages/apps/human-app/server/src/modules/cron-job/cron-job.service.ts index 089324b618..b5fc8ae2f0 100644 --- a/packages/apps/human-app/server/src/modules/cron-job/cron-job.service.ts +++ b/packages/apps/human-app/server/src/modules/cron-job/cron-job.service.ts @@ -1,22 +1,23 @@ -import { Injectable, Logger } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; +import { SchedulerRegistry } from '@nestjs/schedule'; import { CronJob } from 'cron'; +import { EnvironmentConfigService } from '../../common/config/environment-config.service'; +import { + JobDiscoveryFieldName, + JobStatus, +} from '../../common/enums/global-common'; import { ExchangeOracleGateway } from '../../integrations/exchange-oracle/exchange-oracle.gateway'; import { ReputationOracleGateway } from '../../integrations/reputation-oracle/reputation-oracle.gateway'; +import logger from '../../logger'; +import { JobsDiscoveryService } from '../jobs-discovery/jobs-discovery.service'; import { DiscoveredJob, JobsDiscoveryParams, JobsDiscoveryParamsCommand, JobsDiscoveryResponse, } from '../jobs-discovery/model/jobs-discovery.model'; -import { EnvironmentConfigService } from '../../common/config/environment-config.service'; -import { OracleDiscoveryService } from '../oracle-discovery/oracle-discovery.service'; import { DiscoveredOracle } from '../oracle-discovery/model/oracle-discovery.model'; -import { - JobDiscoveryFieldName, - JobStatus, -} from '../../common/enums/global-common'; -import { SchedulerRegistry } from '@nestjs/schedule'; -import { JobsDiscoveryService } from '../jobs-discovery/jobs-discovery.service'; +import { OracleDiscoveryService } from '../oracle-discovery/oracle-discovery.service'; function assertJobsDiscoveryResponseItemsFormat( items: JobsDiscoveryResponse['results'], @@ -41,7 +42,8 @@ function assertJobsDiscoveryResponseItemsFormat( @Injectable() export class CronJobService { - private readonly logger = new Logger(CronJobService.name); + private readonly logger = logger.child({ context: CronJobService.name }); + constructor( private readonly reputationOracleGateway: ReputationOracleGateway, private readonly exchangeOracleGateway: ExchangeOracleGateway, @@ -65,7 +67,7 @@ export class CronJobService { } async updateJobsListCron() { - this.logger.log('CRON START'); + this.logger.info('Update jobs list START'); const oracles = await this.oracleDiscoveryService.discoverOracles(); @@ -80,9 +82,11 @@ export class CronJobService { for (const oracle of oracles) { if (oracle.executionsToSkip > 0) { - this.logger.log( - `Skipping execution for oracle: ${oracle.address}. Remaining skips: ${oracle.executionsToSkip}`, - ); + this.logger.info('Skipping jobs list update for oracle', { + chainId: oracle.chainId, + address: oracle.address, + executionsToSkip: oracle.executionsToSkip, + }); await this.oracleDiscoveryService.updateOracleInCache({ ...oracle, @@ -96,11 +100,11 @@ export class CronJobService { 'Bearer ' + response.access_token, ); } - } catch (e) { - this.logger.error(e); + } catch (error) { + this.logger.error('Error in update jobs list job', error); } - this.logger.log('CRON END'); + this.logger.info('Update jobs list END'); } async updateJobsListCache(oracle: DiscoveredOracle, token: string) { @@ -151,8 +155,12 @@ export class CronJobService { }); await this.jobsDiscoveryService.setCachedJobs(oracle.address, allResults); - } catch (e) { - this.logger.error(e); + } catch (error) { + this.logger.error('Error while updating jobs list for oracle', { + chainId: oracle.chainId, + address: oracle.address, + error, + }); await this.handleJobListError(oracle); } } diff --git a/packages/apps/human-app/server/src/modules/cron-job/spec/cron-job.service.spec.ts b/packages/apps/human-app/server/src/modules/cron-job/spec/cron-job.service.spec.ts index eca3cb0c17..d05258f95b 100644 --- a/packages/apps/human-app/server/src/modules/cron-job/spec/cron-job.service.spec.ts +++ b/packages/apps/human-app/server/src/modules/cron-job/spec/cron-job.service.spec.ts @@ -223,7 +223,14 @@ describe('CronJobService', () => { await service.updateJobsListCache(oracle, token); - expect(loggerErrorSpy).toHaveBeenCalledWith(error); + expect(loggerErrorSpy).toHaveBeenCalledWith( + 'Error while updating jobs list for oracle', + { + chainId: oracle.chainId, + address: oracle.address, + error, + }, + ); expect(handleJobListErrorSpy).toHaveBeenCalledWith(oracle); }); diff --git a/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.controller.ts b/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.controller.ts index 957c848700..69158553d5 100644 --- a/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.controller.ts +++ b/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.controller.ts @@ -1,6 +1,14 @@ import { Mapper } from '@automapper/core'; import { InjectMapper } from '@automapper/nestjs'; -import { Body, Controller, Get, Header, Post, Request } from '@nestjs/common'; +import { + BadRequestException, + Body, + Controller, + Get, + Header, + Post, + Request, +} from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { RequestWithUser } from '../../common/interfaces/jwt'; import { JwtUserData } from '../../common/utils/jwt-token.model'; @@ -47,7 +55,7 @@ export class HCaptchaController { @Request() req: RequestWithUser, ): Promise { if (!req.user.site_key) { - throw new Error('Missing site key'); + throw new BadRequestException('Labeling is not set up'); } const command = this.mapper.map(req.user, JwtUserData, VerifyTokenCommand); command.response = dto.token; @@ -62,7 +70,7 @@ export class HCaptchaController { @Request() req: RequestWithUser, ): Promise { if (!req.user.site_key) { - throw new Error('Missing site key'); + throw new BadRequestException('Labeling is not set up'); } const command = this.mapper.map( req.user, @@ -79,7 +87,7 @@ export class HCaptchaController { @Request() req: RequestWithUser, ): Promise { if (!req.user.email || !req.user.site_key) { - throw new Error('Missing email or site key'); + throw new BadRequestException('Labeling is not set up'); } const command = this.mapper.map(req.user, JwtUserData, UserStatsCommand); return this.service.getUserStats(command); diff --git a/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.service.ts b/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.service.ts index 3b957239b2..4f53306d4e 100644 --- a/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.service.ts +++ b/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.service.ts @@ -1,9 +1,12 @@ -import { HttpException, Inject, Injectable, Logger } from '@nestjs/common'; -import { - VerifyTokenCommand, - VerifyTokenApiResponse, - VerifyTokenResponse, -} from './model/verify-token.model'; +import { CACHE_MANAGER } from '@nestjs/cache-manager'; +import { HttpException, Inject, Injectable } from '@nestjs/common'; +import { Cache } from 'cache-manager'; +import { EnvironmentConfigService } from '../../common/config/environment-config.service'; +import { DAILY_HMT_SPENT_CACHE_KEY } from '../../common/constants/cache'; +import { HCaptchaStatisticsGateway } from '../../integrations/h-captcha-labeling/h-captcha-statistics.gateway'; +import { HCaptchaVerifyGateway } from '../../integrations/h-captcha-labeling/h-captcha-verify.gateway'; +import { ReputationOracleGateway } from '../../integrations/reputation-oracle/reputation-oracle.gateway'; +import logger from '../../logger'; import { DailyHmtSpentCommand, DailyHmtSpentResponse, @@ -12,53 +15,41 @@ import { EnableLabelingCommand, EnableLabelingResponse, } from './model/enable-labeling.model'; -import { EnvironmentConfigService } from '../../common/config/environment-config.service'; -import { CACHE_MANAGER } from '@nestjs/cache-manager'; import { UserStatsCommand, UserStatsResponse } from './model/user-stats.model'; -import { Cache } from 'cache-manager'; -import { HCaptchaStatisticsGateway } from '../../integrations/h-captcha-labeling/h-captcha-statistics.gateway'; -import { ReputationOracleGateway } from '../../integrations/reputation-oracle/reputation-oracle.gateway'; -import { HCaptchaVerifyGateway } from '../../integrations/h-captcha-labeling/h-captcha-verify.gateway'; -import { DAILY_HMT_SPENT_CACHE_KEY } from '../../common/constants/cache'; +import { + VerifyTokenCommand, + VerifyTokenResponse, +} from './model/verify-token.model'; @Injectable() export class HCaptchaService { - private readonly logger = new Logger(HCaptchaService.name); + private readonly logger = logger.child({ context: HCaptchaService.name }); + constructor( - private configService: EnvironmentConfigService, - private hCaptchaLabelingGateway: HCaptchaStatisticsGateway, - private hCaptchaVerifyGateway: HCaptchaVerifyGateway, - private reputationOracleGateway: ReputationOracleGateway, - @Inject(CACHE_MANAGER) private cacheManager: Cache, + private readonly configService: EnvironmentConfigService, + private readonly hCaptchaLabelingGateway: HCaptchaStatisticsGateway, + private readonly hCaptchaVerifyGateway: HCaptchaVerifyGateway, + private readonly reputationOracleGateway: ReputationOracleGateway, + @Inject(CACHE_MANAGER) private readonly cacheManager: Cache, ) {} async verifyToken(command: VerifyTokenCommand): Promise { this.checkIfHcaptchaSitekeyPresent(command.sitekey); - const response = - await this.hCaptchaVerifyGateway.sendTokenToVerify(command); - if (response && response.success) { + + const result = await this.hCaptchaVerifyGateway.sendTokenToVerify(command); + if (result?.success) { return new VerifyTokenResponse('CAPTCHA was verified successfully'); } - const errorMessage = this.createHCaptchaVerificationErrorMessage(response); - this.logger.error(errorMessage); - throw new HttpException(errorMessage, 400); - } - private createHCaptchaVerificationErrorMessage( - response: VerifyTokenApiResponse | undefined, - ): string { - let message = 'Failed to verify h-captcha token. '; - if (response) { - const errorCodes: any = response['error-codes']; - if (errorCodes && Array.isArray(errorCodes)) { - message += `Error: ${errorCodes}`; - } else { - message += `"error-codes" array is undefined. Response data: ${JSON.stringify(response)}`; - } - } else { - message += 'Failed to process request'; - } - return message; + + const message = 'Failed to verify hCaptcha token'; + this.logger.error(message, { + success: result?.success, + errorCodes: result?.['error-codes'], + }); + + throw new HttpException(message, 400); } + async enableLabeling( command: EnableLabelingCommand, ): Promise { @@ -69,9 +60,11 @@ export class HCaptchaService { command: DailyHmtSpentCommand, ): Promise { this.checkIfHcaptchaSitekeyPresent(command.siteKey); + let dailyHmtSpent = await this.cacheManager.get( DAILY_HMT_SPENT_CACHE_KEY, ); + if (!dailyHmtSpent) { dailyHmtSpent = await this.hCaptchaLabelingGateway.fetchDailyHmtSpent(); await this.cacheManager.set( @@ -80,23 +73,28 @@ export class HCaptchaService { this.configService.cacheTtlDailyHmtSpent, ); } + return dailyHmtSpent; } async getUserStats(command: UserStatsCommand): Promise { this.checkIfHcaptchaSitekeyPresent(command.siteKey); + let stats = await this.cacheManager.get(command.email); if (stats) { return stats; } + stats = await this.hCaptchaLabelingGateway.fetchUserStats(command.email); await this.cacheManager.set( command.email, stats, this.configService.cacheTtlHCaptchaUserStats, ); + return stats; } + private checkIfHcaptchaSitekeyPresent(siteKey: string) { if (!siteKey) { throw new HttpException('Labeling is not enabled for this account', 400); diff --git a/packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.fixtures.ts b/packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.fixtures.ts index d114d7c6b1..3dc4c3cb1a 100644 --- a/packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.fixtures.ts +++ b/packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.fixtures.ts @@ -133,14 +133,7 @@ export const dailyHmtSpentResponseFixture: DailyHmtSpentResponse = { spend: DAILY_HMT_SPENT, }; -export const errorMessagesFixture = { - withErrorCodes: - 'Failed to verify h-captcha token. Error: invalid-input-response,timeout-or-duplicate', - withoutErrorCodes: - 'Failed to verify h-captcha token. "error-codes" array is undefined. Response data: {}', - withUndefinedErrorCodes: - 'Failed to verify h-captcha token. "error-codes" array is undefined. Response data: {"success":false}', -}; +export const errorMessageFixture = 'Failed to verify hCaptcha token'; export const dropoffDataFixture = { ...DROPOFF_DATA_1, ...DROPOFF_DATA_2, diff --git a/packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.service.spec.ts b/packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.service.spec.ts index 328b55f841..08ec304388 100644 --- a/packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.service.spec.ts +++ b/packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.service.spec.ts @@ -27,7 +27,7 @@ import { unsuccessfulVerifyTokenApiResponseWithErrorCodesFixture, unsuccessfulVerifyTokenApiResponseWithoutErrorCodesFixture, unsuccessfulVerifyTokenApiResponseWithUndefinedErrorCodesFixture, - errorMessagesFixture, + errorMessageFixture, } from './h-captcha.fixtures'; import { hCaptchaStatisticsGatewayMock, @@ -116,14 +116,13 @@ describe('HCaptchaService', () => { const command: VerifyTokenCommand = verifyTokenCommandFixture; const apiResponse: VerifyTokenApiResponse = unsuccessfulVerifyTokenApiResponseWithErrorCodesFixture; - const errorMessage = errorMessagesFixture.withErrorCodes; jest .spyOn(hCaptchaVerifyGateway, 'sendTokenToVerify') .mockResolvedValue(apiResponse); await expect(service.verifyToken(command)).rejects.toThrowError( - errorMessage, + errorMessageFixture, ); }); @@ -131,14 +130,13 @@ describe('HCaptchaService', () => { const command: VerifyTokenCommand = verifyTokenCommandFixture; const apiResponse: VerifyTokenApiResponse = unsuccessfulVerifyTokenApiResponseWithoutErrorCodesFixture; - const errorMessage = errorMessagesFixture.withUndefinedErrorCodes; jest .spyOn(hCaptchaVerifyGateway, 'sendTokenToVerify') .mockResolvedValue(apiResponse); await expect(service.verifyToken(command)).rejects.toThrowError( - errorMessage, + errorMessageFixture, ); }); @@ -146,14 +144,13 @@ describe('HCaptchaService', () => { const command: VerifyTokenCommand = verifyTokenCommandFixture; const apiResponse: VerifyTokenApiResponse = unsuccessfulVerifyTokenApiResponseWithUndefinedErrorCodesFixture; - const errorMessage = errorMessagesFixture.withUndefinedErrorCodes; jest .spyOn(hCaptchaVerifyGateway, 'sendTokenToVerify') .mockResolvedValue(apiResponse); - await expect(service.verifyToken(command)).rejects.toThrowError( - errorMessage, + await expect(service.verifyToken(command)).rejects.toThrow( + errorMessageFixture, ); }); }); diff --git a/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.controller.ts b/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.controller.ts index 72c1a2d3e3..29290d7136 100644 --- a/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.controller.ts +++ b/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.controller.ts @@ -37,7 +37,7 @@ export class JobAssignmentController { @ApiOperation({ summary: 'Request to assign a job to a logged user', }) - public async assignJob( + async assignJob( @Body() jobAssignmentDto: JobAssignmentDto, @Request() req: RequestWithUser, ): Promise { @@ -54,7 +54,7 @@ export class JobAssignmentController { @ApiOperation({ summary: 'Request to get jobs assigned to a logged user', }) - public async getAssignedJobs( + async getAssignedJobs( @Query() jobsAssignmentParamsDto: JobsFetchParamsDto, @Request() req: RequestWithUser, ): Promise { @@ -72,7 +72,7 @@ export class JobAssignmentController { @ApiOperation({ summary: 'Request to resign from assigment', }) - public async resignAssigment( + async resignAssigment( @Body() dto: ResignJobDto, @Request() req: RequestWithUser, ) { @@ -85,7 +85,7 @@ export class JobAssignmentController { @ApiOperation({ summary: 'Request to refresh assigments data', }) - public async refreshAssigments( + async refreshAssigments( @Body() dto: RefreshJobDto, @Request() req: RequestWithUser, ) { diff --git a/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.service.ts b/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.service.ts index 7dd491cb9e..0f2685eee0 100644 --- a/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.service.ts +++ b/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.service.ts @@ -1,5 +1,5 @@ import { CACHE_MANAGER } from '@nestjs/cache-manager'; -import { Inject, Injectable, Logger } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common'; import { ethers } from 'ethers'; import { Cache } from 'cache-manager'; import { decode } from 'jsonwebtoken'; @@ -21,16 +21,19 @@ import { paginateAndSortResults, } from '../../common/utils/pagination.utils'; import { JOB_ASSIGNMENT_CACHE_KEY } from '../../common/constants/cache'; +import logger from '../../logger'; @Injectable() export class JobAssignmentService { - logger = new Logger(JobAssignmentService.name); + private readonly logger = logger.child({ + context: JobAssignmentService.name, + }); constructor( private readonly configService: EnvironmentConfigService, private readonly exchangeOracleGateway: ExchangeOracleGateway, private readonly escrowUtilsGateway: EscrowUtilsGateway, - @Inject(CACHE_MANAGER) private cacheManager: Cache, + @Inject(CACHE_MANAGER) private readonly cacheManager: Cache, ) {} private getEvmAddressFromToken(token: string): string { @@ -66,12 +69,7 @@ export class JobAssignmentService { ); assignmentsParamsCommand.token = command.token; - this.updateAssignmentsCache(assignmentsParamsCommand).catch((error) => { - this.logger.error( - `Failed to update assignments cache after processing assignment: ${error.message}`, - error.stack, - ); - }); + void this.updateAssignmentsCache(assignmentsParamsCommand); return response; } @@ -84,12 +82,7 @@ export class JobAssignmentService { assignmentsParamsCommand.oracleAddress = command.oracleAddress; assignmentsParamsCommand.token = command.token; - this.updateAssignmentsCache(assignmentsParamsCommand).catch((error) => { - this.logger.error( - `Failed to update assignments cache after processing resignment: ${error.message}`, - error.stack, - ); - }); + void this.updateAssignmentsCache(assignmentsParamsCommand); return response; } @@ -162,41 +155,50 @@ export class JobAssignmentService { }); } - public async updateAssignmentsCache( - command: JobsFetchParamsCommand, - ): Promise { + async updateAssignmentsCache(command: JobsFetchParamsCommand): Promise { const evmAddress = this.getEvmAddressFromToken(command.token); - const cacheRetentionDate = this.getCacheRetentionDate(); - const cacheKey = this.makeJobAssignmentCacheKey( - evmAddress, - command.oracleAddress, - ); - const cachedAssignments = - (await this.cacheManager.get(cacheKey)) || []; + try { + const cacheRetentionDate = this.getCacheRetentionDate(); + const cacheKey = this.makeJobAssignmentCacheKey( + evmAddress, + command.oracleAddress, + ); + + const cachedAssignments = + (await this.cacheManager.get(cacheKey)) || []; - const cachedAssignmentsToRetain = []; - let latestUpdatedAt = cacheRetentionDate; - for (const jobAssignment of cachedAssignments) { - if (jobAssignment.updated_at > cacheRetentionDate) { - cachedAssignmentsToRetain.push(jobAssignment); - } + const cachedAssignmentsToRetain = []; + let latestUpdatedAt = cacheRetentionDate; + for (const jobAssignment of cachedAssignments) { + if (jobAssignment.updated_at > cacheRetentionDate) { + cachedAssignmentsToRetain.push(jobAssignment); + } - if (jobAssignment.updated_at > latestUpdatedAt) { - latestUpdatedAt = jobAssignment.updated_at; + if (jobAssignment.updated_at > latestUpdatedAt) { + latestUpdatedAt = jobAssignment.updated_at; + } } - } - if (!command.data) command.data = new JobsFetchParams(); - command.data.updatedAfter = latestUpdatedAt; + if (!command.data) command.data = new JobsFetchParams(); + command.data.updatedAfter = latestUpdatedAt; - const fetchedAssignments = await this.fetchAllAssignedJobs(command); + const fetchedAssignments = await this.fetchAllAssignedJobs(command); - const mergedData = this.mergeAssignments( - cachedAssignmentsToRetain, - fetchedAssignments, - ); - await this.cacheManager.set(cacheKey, mergedData); + const mergedData = this.mergeAssignments( + cachedAssignmentsToRetain, + fetchedAssignments, + ); + await this.cacheManager.set(cacheKey, mergedData); + } catch (error) { + this.logger.error('Failed to update assignments cache', { + chainId: command.data.chainId, + oracleAddress: command.oracleAddress, + escrowAddress: command.data.escrowAddress, + userAddress: evmAddress, + error, + }); + } } private async fetchAllAssignedJobs( diff --git a/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.controller.ts b/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.controller.ts index 321f0943f3..7a6d1b8772 100644 --- a/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.controller.ts +++ b/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.controller.ts @@ -18,6 +18,7 @@ import { GetOraclesQuery, } from './model/oracle-discovery.model'; import { OracleDiscoveryService } from './oracle-discovery.service'; +import Environment from '../../common/utils/environment'; @ApiTags('Oracle-Discovery') @Controller() @@ -48,7 +49,7 @@ export class OracleDiscoveryController { const command = this.mapper.map(query, GetOraclesQuery, GetOraclesCommand); const oracles = await this.oracleDiscoveryService.getOracles(command); - if (process.env.NODE_ENV !== 'production') { + if (!Environment.isProduction()) { return oracles; } 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 898acc2612..b8fdc0b6d7 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 @@ -1,23 +1,26 @@ -import _ from 'lodash'; import { ChainId, IOperator, OperatorUtils, Role } from '@human-protocol/sdk'; -import { Inject, Injectable, Logger } from '@nestjs/common'; import { CACHE_MANAGER } from '@nestjs/cache-manager'; +import { Inject, Injectable } from '@nestjs/common'; import { Cache } from 'cache-manager'; +import _ from 'lodash'; +import { EnvironmentConfigService } from '../../common/config/environment-config.service'; +import { KvStoreGateway } from '../../integrations/kv-store/kv-store.gateway'; +import logger from '../../logger'; import { DiscoveredOracle, GetOraclesCommand, } from './model/oracle-discovery.model'; -import { EnvironmentConfigService } from '../../common/config/environment-config.service'; -import { KvStoreGateway } from '../../integrations/kv-store/kv-store.gateway'; @Injectable() export class OracleDiscoveryService { - logger = new Logger(OracleDiscoveryService.name); + private readonly logger = logger.child({ + context: OracleDiscoveryService.name, + }); constructor( - @Inject(CACHE_MANAGER) private cacheManager: Cache, - private configService: EnvironmentConfigService, - private kvStoreGateway: KvStoreGateway, + @Inject(CACHE_MANAGER) private readonly cacheManager: Cache, + private readonly configService: EnvironmentConfigService, + private readonly kvStoreGateway: KvStoreGateway, ) {} async getOracles(command: GetOraclesCommand): Promise { @@ -117,10 +120,10 @@ export class OracleDiscoveryService { return discoveredOracles; } catch (error) { - this.logger.error( - `Failed to discover oracles for chain '${chainId}':`, + this.logger.error('Failed to discover oracles for chain', { + chainId, error, - ); + }); return []; } } diff --git a/packages/apps/human-app/server/src/modules/oracle-discovery/spec/oracle-discovery.service.spec.ts b/packages/apps/human-app/server/src/modules/oracle-discovery/spec/oracle-discovery.service.spec.ts index 9005f40ec0..8817fb1f22 100644 --- a/packages/apps/human-app/server/src/modules/oracle-discovery/spec/oracle-discovery.service.spec.ts +++ b/packages/apps/human-app/server/src/modules/oracle-discovery/spec/oracle-discovery.service.spec.ts @@ -180,8 +180,11 @@ describe('OracleDiscoveryService', () => { expect(result).toEqual(errorResponse); expect(loggerErrorSpy).toHaveBeenCalledWith( - `Failed to discover oracles for chain '${ChainId.POLYGON_AMOY}':`, - error, + 'Failed to discover oracles for chain', + { + chainId: ChainId.POLYGON_AMOY, + error, + }, ); }); diff --git a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts index d0d6a808e8..60e4b5b3f2 100644 --- a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts @@ -52,6 +52,8 @@ export class ExceptionFilter implements IExceptionFilter { this.logger.error('Unhandled exception', exception); + response.removeHeader('Cache-Control'); + response.status(status).json({ statusCode: status, timestamp: new Date().toISOString(), diff --git a/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts b/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts index d7d051436d..3b5e94fc68 100644 --- a/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts +++ b/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts @@ -58,6 +58,8 @@ export class ExceptionFilter implements IExceptionFilter { this.logger.error('Unhandled exception', exception); } + response.removeHeader('Cache-Control'); + response.status(status).json( Object.assign( { diff --git a/yarn.lock b/yarn.lock index a8d8c1a0a0..da438a1e05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4303,6 +4303,7 @@ __metadata: "@automapper/classes": "npm:^8.8.1" "@automapper/core": "npm:^8.8.1" "@automapper/nestjs": "npm:^8.8.1" + "@human-protocol/logger": "workspace:*" "@human-protocol/sdk": "workspace:*" "@nestjs/axios": "npm:^3.1.2" "@nestjs/cache-manager": "npm:^2.2.1" From b7918e3f95bf6aa4584774ed2bfc931d49516aab Mon Sep 17 00:00:00 2001 From: Dmitry Nechay Date: Fri, 8 Aug 2025 16:40:35 +0300 Subject: [PATCH 11/14] refactor: remove unnecessary logs from services (#3497) --- packages/apps/dashboard/server/package.json | 2 - .../server/src/modules/stats/stats.service.ts | 422 ++++++++++-------- .../exchange-oracle/server/package.json | 2 - .../src/common/exceptions/exception.filter.ts | 7 +- .../worker/jobs/services/jobs.service.ts | 2 +- packages/apps/human-app/server/package.json | 3 - .../spec/reputation-oracle.gateway.spec.ts | 24 +- .../src/modules/abuse/abuse.controller.ts | 11 +- .../email-confirmation.controller.ts | 10 +- .../modules/h-captcha/h-captcha.controller.ts | 15 +- .../job-assignment.controller.ts | 13 +- .../kyc-procedure/kyc-procedure.controller.ts | 11 +- .../server/src/modules/nda/nda.module.ts | 2 +- .../oracle-discovery.controller.ts | 2 +- .../password-reset.controller.ts | 12 +- .../prepare-signature.controller.ts | 7 +- .../register-address.controller.ts | 7 +- .../token-refresh/token-refresh.controller.ts | 7 +- .../user-operator/operator.controller.ts | 16 +- .../modules/user-worker/worker.controller.ts | 22 +- .../human-app/server/test/app.e2e-spec.ts | 131 ------ .../test/fixtures/user-operator.fixture.ts | 12 - .../test/fixtures/user-worker.fixture.ts | 11 - .../apps/human-app/server/test/jest-e2e.json | 12 - .../apps/job-launcher/server/package.json | 2 - .../src/common/exceptions/exception.filter.ts | 4 +- .../modules/mutex/mutex-manager.service.ts | 15 +- .../reputation-oracle/server/package.json | 2 - yarn.lock | 146 +----- 29 files changed, 343 insertions(+), 589 deletions(-) delete mode 100644 packages/apps/human-app/server/test/app.e2e-spec.ts delete mode 100644 packages/apps/human-app/server/test/fixtures/user-operator.fixture.ts delete mode 100644 packages/apps/human-app/server/test/fixtures/user-worker.fixture.ts delete mode 100644 packages/apps/human-app/server/test/jest-e2e.json diff --git a/packages/apps/dashboard/server/package.json b/packages/apps/dashboard/server/package.json index 45b9d4ec53..d68596f927 100644 --- a/packages/apps/dashboard/server/package.json +++ b/packages/apps/dashboard/server/package.json @@ -46,7 +46,6 @@ "@types/express": "^4.17.13", "@types/jest": "29.5.1", "@types/node": "22.10.5", - "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", "eslint": "^8.0.1", @@ -55,7 +54,6 @@ "jest": "29.5.0", "prettier": "^3.4.2", "source-map-support": "^0.5.20", - "supertest": "^7.0.0", "ts-jest": "29.2.5", "ts-node": "^10.0.0", "tsconfig-paths": "4.2.0", diff --git a/packages/apps/dashboard/server/src/modules/stats/stats.service.ts b/packages/apps/dashboard/server/src/modules/stats/stats.service.ts index 763724341e..91425d1a9e 100644 --- a/packages/apps/dashboard/server/src/modules/stats/stats.service.ts +++ b/packages/apps/dashboard/server/src/modules/stats/stats.service.ts @@ -4,6 +4,7 @@ import { HttpService } from '@nestjs/axios'; import { Cache, CACHE_MANAGER } from '@nestjs/cache-manager'; import { Inject, Injectable, OnModuleInit } from '@nestjs/common'; import { Cron, SchedulerRegistry } from '@nestjs/schedule'; +import { AxiosError } from 'axios'; import { CronJob } from 'cron'; import dayjs from 'dayjs'; import { lastValueFrom } from 'rxjs'; @@ -18,6 +19,7 @@ import { HMT_PREFIX, RedisConfigService, } from '../../common/config/redis-config.service'; +import * as httpUtils from '../../common/utils/http'; import logger from '../../logger'; import { NetworksService } from '../networks/networks.service'; import { StorageService } from '../storage/storage.service'; @@ -36,7 +38,7 @@ export class StatsService implements OnModuleInit { private readonly logger = logger.child({ context: StatsService.name }); constructor( - @Inject(CACHE_MANAGER) private cacheManager: Cache, + @Inject(CACHE_MANAGER) private readonly cacheManager: Cache, private readonly redisConfigService: RedisConfigService, private readonly networksService: NetworksService, private readonly envConfigService: EnvironmentConfigService, @@ -87,58 +89,71 @@ export class StatsService implements OnModuleInit { startDate, }); - const currentDate = dayjs(); - const dates = []; + try { + const currentDate = dayjs(); + const dates = []; - while (startDate <= currentDate) { - const from = startDate.startOf('month').format('YYYY-MM-DD'); - const to = startDate.endOf('month').format('YYYY-MM-DD'); + while (startDate <= currentDate) { + const from = startDate.startOf('month').format('YYYY-MM-DD'); + const to = startDate.endOf('month').format('YYYY-MM-DD'); - dates.push({ from, to }); + dates.push({ from, to }); - startDate = startDate.add(1, 'month'); - } + startDate = startDate.add(1, 'month'); + } - let hCaptchaStats: HcaptchaDailyStat[][]; + let hCaptchaStats: HcaptchaDailyStat[][]; - try { - const statsFile = await this.storageService.downloadFile( - this.envConfigService.hCaptchaStatsFile, - ); - hCaptchaStats = JSON.parse(statsFile.toString()); - } catch (error) { - this.logger.error('Error while getting hCaptcha stats file', error); - hCaptchaStats = []; - } + try { + const statsFile = await this.storageService.downloadFile( + this.envConfigService.hCaptchaStatsFile, + ); + hCaptchaStats = JSON.parse(statsFile.toString()); + } catch (error) { + this.logger.error('Error while getting hCaptcha stats file', error); + hCaptchaStats = []; + } - for (const range of dates) { - const { data } = await lastValueFrom( - this.httpService.get(this.envConfigService.hCaptchaStatsSource, { - params: { - start_date: range.from, - end_date: range.to, - api_key: this.envConfigService.hCaptchaApiKey, - }, - }), - ); - hCaptchaStats.push(data); - } + for (const range of dates) { + const { data } = await lastValueFrom( + this.httpService.get(this.envConfigService.hCaptchaStatsSource, { + params: { + start_date: range.from, + end_date: range.to, + api_key: this.envConfigService.hCaptchaApiKey, + }, + }), + ); + hCaptchaStats.push(data); + } - for (const monthData of hCaptchaStats) { - for (const [date, value] of Object.entries(monthData)) { - const multiplier = date <= '2022-11-30' ? 18 : 9; - if (value.served) delete value.served; - value.solved *= multiplier; - if (date !== 'total') { - await this.cacheManager.set(`${HCAPTCHA_PREFIX}${date}`, value); - } else { - const dates = Object.keys(monthData).filter((key) => key !== 'total'); - if (dates.length > 0) { - const month = dayjs(dates[0]).format('YYYY-MM'); - await this.cacheManager.set(`${HCAPTCHA_PREFIX}${month}`, value); + for (const monthData of hCaptchaStats) { + for (const [date, value] of Object.entries(monthData)) { + const multiplier = date <= '2022-11-30' ? 18 : 9; + if (value.served) delete value.served; + value.solved *= multiplier; + if (date !== 'total') { + await this.cacheManager.set(`${HCAPTCHA_PREFIX}${date}`, value); + } else { + const dates = Object.keys(monthData).filter( + (key) => key !== 'total', + ); + if (dates.length > 0) { + const month = dayjs(dates[0]).format('YYYY-MM'); + await this.cacheManager.set(`${HCAPTCHA_PREFIX}${month}`, value); + } } } } + } catch (error) { + let formattedError = error; + if (error instanceof AxiosError) { + formattedError = httpUtils.formatAxiosError(error); + } + this.logger.error('Failed to fetch historical hCaptcha stats', { + startDate, + error: formattedError, + }); } } @@ -156,75 +171,97 @@ export class StatsService implements OnModuleInit { this.logger.info('Fetching hCaptcha stats for today', { from, to }); - const { data } = await lastValueFrom( - this.httpService.get(this.envConfigService.hCaptchaStatsSource, { - params: { - start_date: from, - end_date: to, - api_key: this.envConfigService.hCaptchaApiKey, - }, - }), - ); + try { + const { data } = await lastValueFrom( + this.httpService.get(this.envConfigService.hCaptchaStatsSource, { + params: { + start_date: from, + end_date: to, + api_key: this.envConfigService.hCaptchaApiKey, + }, + }), + ); - const multiplier = today <= '2022-11-30' ? 18 : 9; - const stats = data[today]; - if (stats) { - if (stats.served) delete stats.served; - stats.solved *= multiplier; - await this.cacheManager.set(`${HCAPTCHA_PREFIX}${today}`, stats); - } + const multiplier = today <= '2022-11-30' ? 18 : 9; + const stats = data[today]; + if (stats) { + if (stats.served) delete stats.served; + stats.solved *= multiplier; + await this.cacheManager.set(`${HCAPTCHA_PREFIX}${today}`, stats); + } - const currentMonth = dayjs().format('YYYY-MM'); - const daysInMonth = dayjs().daysInMonth(); + const currentMonth = dayjs().format('YYYY-MM'); + const daysInMonth = dayjs().daysInMonth(); - const dates = Array.from( - { length: daysInMonth }, - (_, i) => `${currentMonth}-${String(i + 1).padStart(2, '0')}`, - ); + const dates = Array.from( + { length: daysInMonth }, + (_, i) => `${currentMonth}-${String(i + 1).padStart(2, '0')}`, + ); - const aggregatedStats = await Promise.all( - dates.map(async (date) => { - const dailyStats: HcaptchaDailyStats = await this.cacheManager.get( - `${HCAPTCHA_PREFIX}${date}`, - ); - return dailyStats || { solved: 0 }; - }), - ).then((statsArray) => - statsArray.reduce( - (acc, stats) => { - acc.solved += stats.solved; - return acc; - }, - { solved: 0 }, - ), - ); + const aggregatedStats = await Promise.all( + dates.map(async (date) => { + const dailyStats: HcaptchaDailyStats = await this.cacheManager.get( + `${HCAPTCHA_PREFIX}${date}`, + ); + return dailyStats || { solved: 0 }; + }), + ).then((statsArray) => + statsArray.reduce( + (acc, stats) => { + acc.solved += stats.solved; + return acc; + }, + { solved: 0 }, + ), + ); - await this.cacheManager.set( - `${HCAPTCHA_PREFIX}${currentMonth}`, - aggregatedStats, - ); + await this.cacheManager.set( + `${HCAPTCHA_PREFIX}${currentMonth}`, + aggregatedStats, + ); + } catch (error) { + let formattedError = error; + if (error instanceof AxiosError) { + formattedError = httpUtils.formatAxiosError(error); + } + this.logger.error('Failed to fetch todays hCaptcha stats', { + today, + from, + to, + error: formattedError, + }); + } } @Cron('*/15 * * * *') async fetchHmtGeneralStats() { this.logger.info('Fetching HMT general stats across multiple networks'); - const aggregatedStats: HmtGeneralStatsDto = { - totalHolders: 0, - totalTransactions: 0, - }; - const operatingNetworks = await this.networksService.getOperatingNetworks(); - for (const network of operatingNetworks) { - const statisticsClient = new StatisticsClient(NETWORKS[network]); - const generalStats = await statisticsClient.getHMTStatistics(); - aggregatedStats.totalHolders += generalStats.totalHolders; - aggregatedStats.totalTransactions += generalStats.totalTransferCount; - } + try { + const aggregatedStats: HmtGeneralStatsDto = { + totalHolders: 0, + totalTransactions: 0, + }; + const operatingNetworks = + await this.networksService.getOperatingNetworks(); + for (const network of operatingNetworks) { + const statisticsClient = new StatisticsClient(NETWORKS[network]); + const generalStats = await statisticsClient.getHMTStatistics(); + aggregatedStats.totalHolders += generalStats.totalHolders; + aggregatedStats.totalTransactions += generalStats.totalTransferCount; + } - await this.cacheManager.set( - this.redisConfigService.hmtGeneralStatsCacheKey, - aggregatedStats, - ); + await this.cacheManager.set( + this.redisConfigService.hmtGeneralStatsCacheKey, + aggregatedStats, + ); + } catch (error) { + let formattedError = error; + if (error instanceof AxiosError) { + formattedError = httpUtils.formatAxiosError(error); + } + this.logger.error('Failed to fetch HMT general stats', formattedError); + } } private async isHmtDailyStatsFetched(): Promise { @@ -248,92 +285,107 @@ export class StatsService implements OnModuleInit { private async fetchAndCacheHmtDailyStats(date: string) { const from = new Date(date); const to = new Date(dayjs().format('YYYY-MM-DD')); - const dailyData: Record = {}; - const monthlyData: Record = {}; - - const operatingNetworks = await this.networksService.getOperatingNetworks(); - // Fetch daily data for each network - await Promise.all( - operatingNetworks.map(async (network) => { - const statisticsClient = new StatisticsClient(NETWORKS[network]); - let skip = 0; - let fetchedRecords: DailyHMTData[] = []; - - do { - fetchedRecords = await statisticsClient.getHMTDailyData({ - from, - to, - first: 1000, // Max subgraph query size - skip, - }); - - for (const record of fetchedRecords) { - const dailyCacheKey = `${HMT_PREFIX}${ - record.timestamp.toISOString().split('T')[0] - }`; - - // Sum daily values - if (!dailyData[dailyCacheKey]) { - dailyData[dailyCacheKey] = { - totalTransactionAmount: '0', - totalTransactionCount: 0, - dailyUniqueSenders: 0, - dailyUniqueReceivers: 0, - }; - } - - dailyData[dailyCacheKey].totalTransactionAmount = ( - BigInt(dailyData[dailyCacheKey].totalTransactionAmount) + - BigInt(record.totalTransactionAmount) - ).toString(); - dailyData[dailyCacheKey].totalTransactionCount += - record.totalTransactionCount; - dailyData[dailyCacheKey].dailyUniqueSenders += - record.dailyUniqueSenders; - dailyData[dailyCacheKey].dailyUniqueReceivers += - record.dailyUniqueReceivers; - - // Sum monthly values - const month = dayjs(record.timestamp).format('YYYY-MM'); - if (!monthlyData[month]) { - monthlyData[month] = { - totalTransactionAmount: '0', - totalTransactionCount: 0, - dailyUniqueSenders: 0, - dailyUniqueReceivers: 0, - }; + try { + const dailyData: Record = {}; + const monthlyData: Record = {}; + + const operatingNetworks = + await this.networksService.getOperatingNetworks(); + + // Fetch daily data for each network + await Promise.all( + operatingNetworks.map(async (network) => { + const statisticsClient = new StatisticsClient(NETWORKS[network]); + let skip = 0; + let fetchedRecords: DailyHMTData[] = []; + + do { + fetchedRecords = await statisticsClient.getHMTDailyData({ + from, + to, + first: 1000, // Max subgraph query size + skip, + }); + + for (const record of fetchedRecords) { + const dailyCacheKey = `${HMT_PREFIX}${ + record.timestamp.toISOString().split('T')[0] + }`; + + // Sum daily values + if (!dailyData[dailyCacheKey]) { + dailyData[dailyCacheKey] = { + totalTransactionAmount: '0', + totalTransactionCount: 0, + dailyUniqueSenders: 0, + dailyUniqueReceivers: 0, + }; + } + + dailyData[dailyCacheKey].totalTransactionAmount = ( + BigInt(dailyData[dailyCacheKey].totalTransactionAmount) + + BigInt(record.totalTransactionAmount) + ).toString(); + dailyData[dailyCacheKey].totalTransactionCount += + record.totalTransactionCount; + dailyData[dailyCacheKey].dailyUniqueSenders += + record.dailyUniqueSenders; + dailyData[dailyCacheKey].dailyUniqueReceivers += + record.dailyUniqueReceivers; + + // Sum monthly values + const month = dayjs(record.timestamp).format('YYYY-MM'); + if (!monthlyData[month]) { + monthlyData[month] = { + totalTransactionAmount: '0', + totalTransactionCount: 0, + dailyUniqueSenders: 0, + dailyUniqueReceivers: 0, + }; + } + + monthlyData[month].totalTransactionAmount = ( + BigInt(monthlyData[month].totalTransactionAmount) + + BigInt(record.totalTransactionAmount) + ).toString(); + monthlyData[month].totalTransactionCount += + record.totalTransactionCount; + monthlyData[month].dailyUniqueSenders += + record.dailyUniqueSenders; + monthlyData[month].dailyUniqueReceivers += + record.dailyUniqueReceivers; } - monthlyData[month].totalTransactionAmount = ( - BigInt(monthlyData[month].totalTransactionAmount) + - BigInt(record.totalTransactionAmount) - ).toString(); - monthlyData[month].totalTransactionCount += - record.totalTransactionCount; - monthlyData[month].dailyUniqueSenders += record.dailyUniqueSenders; - monthlyData[month].dailyUniqueReceivers += - record.dailyUniqueReceivers; - } - - skip += 1000; - } while (fetchedRecords.length === 1000); - }), - ); + skip += 1000; + } while (fetchedRecords.length === 1000); + }), + ); - // Store daily records - for (const [dailyCacheKey, stats] of Object.entries(dailyData)) { - await this.cacheManager.set(dailyCacheKey, stats); - } + // Store daily records + for (const [dailyCacheKey, stats] of Object.entries(dailyData)) { + await this.cacheManager.set(dailyCacheKey, stats); + } - // Store monthly records - for (const [month, stats] of Object.entries(monthlyData)) { - const monthlyCacheKey = `${HMT_PREFIX}${month}`; - await this.cacheManager.set(monthlyCacheKey, stats); + // Store monthly records + for (const [month, stats] of Object.entries(monthlyData)) { + const monthlyCacheKey = `${HMT_PREFIX}${month}`; + await this.cacheManager.set(monthlyCacheKey, stats); + } + } catch (error) { + let formattedError = error; + if (error instanceof AxiosError) { + formattedError = httpUtils.formatAxiosError(error); + } + this.logger.error('Failed to fetch HMT daily status', { + from, + to, + error: formattedError, + }); } } - public async hmtPrice(): Promise { + async hmtPrice(): Promise { const cachedHmtPrice: number = await this.cacheManager.get( this.redisConfigService.hmtPriceCacheKey, ); @@ -384,10 +436,7 @@ export class StatsService implements OnModuleInit { return hmtPrice; } - public async hCaptchaStats( - from: string, - to: string, - ): Promise { + async hCaptchaStats(from: string, to: string): Promise { let startDate = dayjs(from); const endDate = dayjs(to); const dates = []; @@ -412,7 +461,7 @@ export class StatsService implements OnModuleInit { return stats.filter(Boolean); } - public async hCaptchaGeneralStats(): Promise { + async hCaptchaGeneralStats(): Promise { let startDate = dayjs(HCAPTCHA_STATS_START_DATE); const currentDate = dayjs(); const dates = []; @@ -444,7 +493,7 @@ export class StatsService implements OnModuleInit { return aggregatedStats; } - public async hmtGeneralStats(): Promise { + async hmtGeneralStats(): Promise { const data = await this.cacheManager.get( this.redisConfigService.hmtGeneralStatsCacheKey, ); @@ -452,10 +501,7 @@ export class StatsService implements OnModuleInit { return data; } - public async hmtDailyStats( - from: string, - to: string, - ): Promise { + async hmtDailyStats(from: string, to: string): Promise { let startDate = dayjs(from); const endDate = dayjs(to); const dates = []; diff --git a/packages/apps/fortune/exchange-oracle/server/package.json b/packages/apps/fortune/exchange-oracle/server/package.json index e250a658bb..0fefc7173a 100644 --- a/packages/apps/fortune/exchange-oracle/server/package.json +++ b/packages/apps/fortune/exchange-oracle/server/package.json @@ -70,7 +70,6 @@ "@types/node": "22.10.5", "@types/passport": "^0", "@types/pg": "8.11.10", - "@types/supertest": "^6.0.2", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", "eslint": "^8.55.0", @@ -79,7 +78,6 @@ "jest": "29.7.0", "prettier": "^3.4.2", "source-map-support": "^0.5.20", - "supertest": "^7.0.0", "ts-jest": "29.2.5", "ts-node": "^10.9.2", "tsconfig-paths": "4.2.0", diff --git a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts index c2e2cd7a90..807da5fbec 100644 --- a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts @@ -33,10 +33,11 @@ export class ExceptionFilter implements IExceptionFilter { return HttpStatus.CONFLICT; } else if (exception instanceof ServerError) { return HttpStatus.UNPROCESSABLE_ENTITY; - } else if (exception.statusCode) { - return exception.statusCode; } - return HttpStatus.INTERNAL_SERVER_ERROR; + + const exceptionStatusCode = exception.statusCode || exception.status; + + return exceptionStatusCode || HttpStatus.INTERNAL_SERVER_ERROR; } catch(exception: any, host: ArgumentsHost) { diff --git a/packages/apps/human-app/frontend/src/modules/worker/jobs/services/jobs.service.ts b/packages/apps/human-app/frontend/src/modules/worker/jobs/services/jobs.service.ts index 166dea37f9..5f4e52d2bc 100644 --- a/packages/apps/human-app/frontend/src/modules/worker/jobs/services/jobs.service.ts +++ b/packages/apps/human-app/frontend/src/modules/worker/jobs/services/jobs.service.ts @@ -93,7 +93,7 @@ async function resignJob(data: RejectTaskBody) { async function refreshJobs(data: RefreshJobsBody) { try { - await authorizedHumanAppApiClient.put(apiPaths.refreshJobs, { + await authorizedHumanAppApiClient.post(apiPaths.refreshJobs, { body: { ...data }, }); } catch (error: unknown) { diff --git a/packages/apps/human-app/server/package.json b/packages/apps/human-app/server/package.json index 54e5696427..a99b3fa8ed 100644 --- a/packages/apps/human-app/server/package.json +++ b/packages/apps/human-app/server/package.json @@ -18,7 +18,6 @@ "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", - "test:e2e": "jest --config ./test/jest-e2e.json", "generate-env-doc": "ts-node scripts/generate-env-doc.ts" }, "dependencies": { @@ -63,7 +62,6 @@ "@types/lodash": "^4.17.14", "@types/node": "22.10.5", "@types/passport": "^0", - "@types/supertest": "^2.0.15", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", "eslint": "^8.55.0", @@ -73,7 +71,6 @@ "nock": "^13.5.1", "prettier": "^3.4.2", "source-map-support": "^0.5.20", - "supertest": "^7.0.0", "ts-jest": "29.2.5", "ts-node": "^10.9.2", "tsconfig-paths": "4.2.0", diff --git a/packages/apps/human-app/server/src/integrations/reputation-oracle/spec/reputation-oracle.gateway.spec.ts b/packages/apps/human-app/server/src/integrations/reputation-oracle/spec/reputation-oracle.gateway.spec.ts index 704699c472..bec7e9af5e 100644 --- a/packages/apps/human-app/server/src/integrations/reputation-oracle/spec/reputation-oracle.gateway.spec.ts +++ b/packages/apps/human-app/server/src/integrations/reputation-oracle/spec/reputation-oracle.gateway.spec.ts @@ -136,7 +136,7 @@ describe('ReputationOracleGateway', () => { it('should successfully call the reputation oracle worker signup endpoint', async () => { nock('https://example.com') .post('/auth/signup', expectedData) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -189,7 +189,7 @@ describe('ReputationOracleGateway', () => { it('should successfully call the reputation oracle exchange oracle registration endpoint', async () => { nock('https://example.com') .post('/user/exchange-oracle-registration', expectedData) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -297,7 +297,7 @@ describe('ReputationOracleGateway', () => { nock('https://expample.com') .post('/auth/web3/signup', expectedData) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -323,7 +323,7 @@ describe('ReputationOracleGateway', () => { it('should successfully call the reputation oracle worker signin endpoint', async () => { nock('https://example.com') .post('/auth/signin', expectedData) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -376,7 +376,7 @@ describe('ReputationOracleGateway', () => { nock('https://example.com') .post('/email-confirmation/email-verification', { ...data }) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -430,7 +430,7 @@ describe('ReputationOracleGateway', () => { .post('/auth/resend-email-verification', { ...data, }) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -488,7 +488,7 @@ describe('ReputationOracleGateway', () => { .post('/auth/forgot-password', { ...data, }) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -539,7 +539,7 @@ describe('ReputationOracleGateway', () => { .post('/auth/restore-password', { ...data, }) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -647,7 +647,7 @@ describe('ReputationOracleGateway', () => { .post('/user/disable-operator', { ...data, }) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); @@ -703,7 +703,7 @@ describe('ReputationOracleGateway', () => { describe('sendKycProcedureStart', () => { it('should successfully call the reputation oracle endpoint', async () => { - nock('https://example.com').post('/kyc/start', {}).reply(201, ''); + nock('https://example.com').post('/kyc/start', {}).reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); await expect( service.sendKycProcedureStart('token'), @@ -749,7 +749,7 @@ describe('ReputationOracleGateway', () => { nock('https://example.com') .post('/labeler/register', {}) - .reply(201, enableLabelingResponseFixture); + .reply(200, enableLabelingResponseFixture); httpServiceMock.request.mockReturnValue(of({})); @@ -832,7 +832,7 @@ describe('ReputationOracleGateway', () => { .post('/auth/refresh', { ...data, }) - .reply(201, ''); + .reply(200, ''); httpServiceMock.request.mockReturnValue(of({})); diff --git a/packages/apps/human-app/server/src/modules/abuse/abuse.controller.ts b/packages/apps/human-app/server/src/modules/abuse/abuse.controller.ts index 3af5366983..cfca481dd1 100644 --- a/packages/apps/human-app/server/src/modules/abuse/abuse.controller.ts +++ b/packages/apps/human-app/server/src/modules/abuse/abuse.controller.ts @@ -1,6 +1,6 @@ import { Mapper } from '@automapper/core'; import { InjectMapper } from '@automapper/nestjs'; -import { Body, Controller, Get, Post, Request } from '@nestjs/common'; +import { Body, Controller, Get, HttpCode, Post, Request } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, @@ -24,7 +24,6 @@ export class AbuseController { @InjectMapper() private readonly mapper: Mapper, ) {} - @Post('/report') @ApiOperation({ summary: 'Report an identified abuse', }) @@ -32,7 +31,9 @@ export class AbuseController { status: 200, description: 'Abuse report successfully submitted', }) - public async reportAbuse( + @HttpCode(200) + @Post('/report') + async reportAbuse( @Body() AbuseDto: ReportAbuseDto, @Request() req: RequestWithUser, ): Promise { @@ -45,7 +46,6 @@ export class AbuseController { return this.service.reportAbuse(AbuseCommand); } - @Get('/reports') @ApiOperation({ summary: 'Retrieve all abuse entities created by the authenticated user', }) @@ -54,7 +54,8 @@ export class AbuseController { description: 'List of abuse reports', type: ReportedAbuseResponse, }) - public async getUserAbuseReports( + @Get('/reports') + async getUserAbuseReports( @Request() req: RequestWithUser, ): Promise { return this.service.getUserAbuseReports(req.token); diff --git a/packages/apps/human-app/server/src/modules/email-confirmation/email-confirmation.controller.ts b/packages/apps/human-app/server/src/modules/email-confirmation/email-confirmation.controller.ts index ca6367b918..ae56fb2ec6 100644 --- a/packages/apps/human-app/server/src/modules/email-confirmation/email-confirmation.controller.ts +++ b/packages/apps/human-app/server/src/modules/email-confirmation/email-confirmation.controller.ts @@ -1,6 +1,6 @@ import { Mapper } from '@automapper/core'; import { InjectMapper } from '@automapper/nestjs'; -import { Body, Controller, Post, Request } from '@nestjs/common'; +import { Body, Controller, HttpCode, Post, Request } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { Public } from '../../common/decorators'; import { RequestWithUser } from '../../common/interfaces/jwt'; @@ -26,8 +26,9 @@ export class EmailConfirmationController { summary: 'Endpoint to verify the user email address', }) @Public() + @HttpCode(200) @Post('/email-verification') - public async verifyEmail( + async verifyEmail( @Body() emailVerificationDto: EmailVerificationDto, ): Promise { const emailVerificationCommand = this.mapper.map( @@ -38,12 +39,13 @@ export class EmailConfirmationController { return this.service.processEmailVerification(emailVerificationCommand); } - @Post('/resend-email-verification') @ApiOperation({ summary: 'Endpoint to resend the email verification link', }) @ApiBearerAuth() - public async resendEmailVerification( + @HttpCode(200) + @Post('/resend-email-verification') + async resendEmailVerification( @Body() resendEmailVerificationDto: ResendEmailVerificationDto, @Request() req: RequestWithUser, ): Promise { diff --git a/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.controller.ts b/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.controller.ts index 69158553d5..b2fcec4ebb 100644 --- a/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.controller.ts +++ b/packages/apps/human-app/server/src/modules/h-captcha/h-captcha.controller.ts @@ -6,6 +6,7 @@ import { Controller, Get, Header, + HttpCode, Post, Request, } from '@nestjs/common'; @@ -38,8 +39,9 @@ export class HCaptchaController { ) {} @ApiOperation({ summary: 'Enables h-captcha labeling' }) + @HttpCode(200) @Post('/enable') - public async enableLabeling( + async enableLabeling( @Request() req: RequestWithUser, ): Promise { const command = { @@ -49,8 +51,9 @@ export class HCaptchaController { } @ApiOperation({ summary: 'Sends solution for verification' }) + @HttpCode(200) @Post('/verify') - public async verifyToken( + async verifyToken( @Body() dto: VerifyTokenDto, @Request() req: RequestWithUser, ): Promise { @@ -64,9 +67,9 @@ export class HCaptchaController { } @ApiOperation({ summary: 'Gets global daily HMT spent' }) - @Header('Cache-Control', 'public, max-age=60') + @Header('Cache-Control', 'private, max-age=60') @Get('/daily-hmt-spent') - public async getDailyHmtSpent( + async getDailyHmtSpent( @Request() req: RequestWithUser, ): Promise { if (!req.user.site_key) { @@ -81,9 +84,9 @@ export class HCaptchaController { } @ApiOperation({ summary: 'Gets stats per user' }) - @Header('Cache-Control', 'public, max-age=60') + @Header('Cache-Control', 'private, max-age=60') @Get('/user-stats') - public async getUserStats( + async getUserStats( @Request() req: RequestWithUser, ): Promise { if (!req.user.email || !req.user.site_key) { diff --git a/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.controller.ts b/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.controller.ts index 29290d7136..56f6661b91 100644 --- a/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.controller.ts +++ b/packages/apps/human-app/server/src/modules/job-assignment/job-assignment.controller.ts @@ -4,8 +4,8 @@ import { Body, Controller, Get, + HttpCode, Post, - Put, Query, Request, } from '@nestjs/common'; @@ -33,10 +33,11 @@ export class JobAssignmentController { @InjectMapper() private readonly mapper: Mapper, ) {} - @Post('/job') @ApiOperation({ summary: 'Request to assign a job to a logged user', }) + @HttpCode(200) + @Post('/job') async assignJob( @Body() jobAssignmentDto: JobAssignmentDto, @Request() req: RequestWithUser, @@ -50,10 +51,10 @@ export class JobAssignmentController { return this.service.processJobAssignment(jobAssignmentCommand); } - @Get('/job') @ApiOperation({ summary: 'Request to get jobs assigned to a logged user', }) + @Get('/job') async getAssignedJobs( @Query() jobsAssignmentParamsDto: JobsFetchParamsDto, @Request() req: RequestWithUser, @@ -68,10 +69,11 @@ export class JobAssignmentController { return this.service.processGetAssignedJobs(jobsAssignmentParamsCommand); } - @Post('/resign-job') @ApiOperation({ summary: 'Request to resign from assigment', }) + @HttpCode(200) + @Post('/resign-job') async resignAssigment( @Body() dto: ResignJobDto, @Request() req: RequestWithUser, @@ -81,10 +83,11 @@ export class JobAssignmentController { return this.service.resignJob(command); } - @Put('/refresh') @ApiOperation({ summary: 'Request to refresh assigments data', }) + @HttpCode(200) + @Post('/refresh') async refreshAssigments( @Body() dto: RefreshJobDto, @Request() req: RequestWithUser, diff --git a/packages/apps/human-app/server/src/modules/kyc-procedure/kyc-procedure.controller.ts b/packages/apps/human-app/server/src/modules/kyc-procedure/kyc-procedure.controller.ts index f763113987..86ee4fb556 100644 --- a/packages/apps/human-app/server/src/modules/kyc-procedure/kyc-procedure.controller.ts +++ b/packages/apps/human-app/server/src/modules/kyc-procedure/kyc-procedure.controller.ts @@ -1,4 +1,4 @@ -import { Controller, Get, Post, Request } from '@nestjs/common'; +import { Controller, Get, HttpCode, Post, Request } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { RequestWithUser } from '../../common/interfaces/jwt'; import { KycProcedureService } from './kyc-procedure.service'; @@ -10,21 +10,22 @@ import { KycProcedureStartResponse } from './model/kyc-start.model'; export class KycProcedureController { constructor(private readonly service: KycProcedureService) {} - @Post('/start') @ApiOperation({ summary: 'Endpoint to start Kyc process for the user', }) - public async startKycProcedure( + @HttpCode(200) + @Post('/start') + async startKycProcedure( @Request() req: RequestWithUser, ): Promise { return this.service.processStartKycProcedure(req.token); } - @Get('/on-chain') @ApiOperation({ summary: 'Endpoint to get a signed address for the KYC process.', }) - public async onChainKyc(@Request() req: RequestWithUser): Promise { + @Get('/on-chain') + async onChainKyc(@Request() req: RequestWithUser): Promise { return this.service.processKycOnChain(req.token); } } diff --git a/packages/apps/human-app/server/src/modules/nda/nda.module.ts b/packages/apps/human-app/server/src/modules/nda/nda.module.ts index c02d7c2784..699c8ebd8b 100644 --- a/packages/apps/human-app/server/src/modules/nda/nda.module.ts +++ b/packages/apps/human-app/server/src/modules/nda/nda.module.ts @@ -1,7 +1,7 @@ import { Module } from '@nestjs/common'; -import { NDAService } from 'src/modules/nda/nda.service'; import { ReputationOracleModule } from '../../integrations/reputation-oracle/reputation-oracle.module'; import { SignNDAProfile } from './nda.mapper.profile'; +import { NDAService } from './nda.service'; @Module({ imports: [ReputationOracleModule], diff --git a/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.controller.ts b/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.controller.ts index 7a6d1b8772..e3f0b22d90 100644 --- a/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.controller.ts +++ b/packages/apps/human-app/server/src/modules/oracle-discovery/oracle-discovery.controller.ts @@ -34,7 +34,7 @@ export class OracleDiscoveryController { type: Array, description: 'List of oracles', }) - @Header('Cache-Control', 'public, max-age=60') + @Header('Cache-Control', 'private, max-age=60') @Get('/oracles') public async getOracles( @Request() req: RequestWithUser, diff --git a/packages/apps/human-app/server/src/modules/password-reset/password-reset.controller.ts b/packages/apps/human-app/server/src/modules/password-reset/password-reset.controller.ts index 80fcce0f5a..1aff7ec5ee 100644 --- a/packages/apps/human-app/server/src/modules/password-reset/password-reset.controller.ts +++ b/packages/apps/human-app/server/src/modules/password-reset/password-reset.controller.ts @@ -1,6 +1,6 @@ import { Mapper } from '@automapper/core'; import { InjectMapper } from '@automapper/nestjs'; -import { Body, Controller, Post } from '@nestjs/common'; +import { Body, Controller, HttpCode, Post } from '@nestjs/common'; import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { Public } from '../../common/decorators'; import { @@ -22,11 +22,12 @@ export class PasswordResetController { @InjectMapper() private readonly mapper: Mapper, ) {} - @Post('/forgot-password') @ApiOperation({ summary: 'Endpoint to initiate the password reset process', }) - public async forgotPassword( + @HttpCode(200) + @Post('/forgot-password') + async forgotPassword( @Body() forgotPasswordDto: ForgotPasswordDto, ): Promise { const forgotPasswordCommand = this.mapper.map( @@ -37,11 +38,12 @@ export class PasswordResetController { return await this.service.processForgotPassword(forgotPasswordCommand); } - @Post('/restore-password') @ApiOperation({ summary: 'Endpoint to restore the user password after reset', }) - public async restorePassword(@Body() dto: RestorePasswordDto): Promise { + @HttpCode(200) + @Post('/restore-password') + async restorePassword(@Body() dto: RestorePasswordDto): Promise { const command = this.mapper.map( dto, RestorePasswordDto, diff --git a/packages/apps/human-app/server/src/modules/prepare-signature/prepare-signature.controller.ts b/packages/apps/human-app/server/src/modules/prepare-signature/prepare-signature.controller.ts index 9e8bfbb76c..e1240c9a05 100644 --- a/packages/apps/human-app/server/src/modules/prepare-signature/prepare-signature.controller.ts +++ b/packages/apps/human-app/server/src/modules/prepare-signature/prepare-signature.controller.ts @@ -1,6 +1,6 @@ import { Mapper } from '@automapper/core'; import { InjectMapper } from '@automapper/nestjs'; -import { Body, Controller, Post } from '@nestjs/common'; +import { Body, Controller, HttpCode, Post } from '@nestjs/common'; import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { Public } from '../../common/decorators'; import { @@ -19,12 +19,13 @@ export class PrepareSignatureController { @InjectMapper() private readonly mapper: Mapper, ) {} - @Post('/') @ApiOperation({ summary: 'Endpoint for generating typed structured data objects compliant with EIP-712. The generated object should be convertible to a string format to ensure compatibility with signature mechanisms', }) - public async prepareSignature( + @HttpCode(200) + @Post('/') + async prepareSignature( @Body() prepareSignatureDto: PrepareSignatureDto, ): Promise { const command = this.mapper.map( diff --git a/packages/apps/human-app/server/src/modules/register-address/register-address.controller.ts b/packages/apps/human-app/server/src/modules/register-address/register-address.controller.ts index 3a569e42df..ea3dc98069 100644 --- a/packages/apps/human-app/server/src/modules/register-address/register-address.controller.ts +++ b/packages/apps/human-app/server/src/modules/register-address/register-address.controller.ts @@ -1,6 +1,6 @@ import { Mapper } from '@automapper/core'; import { InjectMapper } from '@automapper/nestjs'; -import { Body, Controller, Post, Request } from '@nestjs/common'; +import { Body, Controller, HttpCode, Post, Request } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { RequestWithUser } from '../../common/interfaces/jwt'; import { @@ -23,11 +23,12 @@ export class RegisterAddressController { this.mapper = mapper; } - @Post('/') @ApiOperation({ summary: 'Register Blockchain Address', }) - public async registerAddress( + @HttpCode(200) + @Post('/') + async registerAddress( @Body() dto: RegisterAddressDto, @Request() req: RequestWithUser, ): Promise { diff --git a/packages/apps/human-app/server/src/modules/token-refresh/token-refresh.controller.ts b/packages/apps/human-app/server/src/modules/token-refresh/token-refresh.controller.ts index bb7892dd68..243357e5a2 100644 --- a/packages/apps/human-app/server/src/modules/token-refresh/token-refresh.controller.ts +++ b/packages/apps/human-app/server/src/modules/token-refresh/token-refresh.controller.ts @@ -1,6 +1,6 @@ import { Mapper } from '@automapper/core'; import { InjectMapper } from '@automapper/nestjs'; -import { Body, Controller, Post } from '@nestjs/common'; +import { Body, Controller, HttpCode, Post } from '@nestjs/common'; import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { Public } from '../../common/decorators'; import { @@ -19,9 +19,10 @@ export class TokenRefreshController { @InjectMapper() private readonly mapper: Mapper, ) {} - @Post('/auth/refresh') @ApiOperation({ summary: 'Refresh token' }) - public refreshToken( + @HttpCode(200) + @Post('/auth/refresh') + async refreshToken( @Body() dto: TokenRefreshDto, ): Promise { const command = this.mapper.map(dto, TokenRefreshDto, TokenRefreshCommand); diff --git a/packages/apps/human-app/server/src/modules/user-operator/operator.controller.ts b/packages/apps/human-app/server/src/modules/user-operator/operator.controller.ts index d66c3c0550..34387e2009 100644 --- a/packages/apps/human-app/server/src/modules/user-operator/operator.controller.ts +++ b/packages/apps/human-app/server/src/modules/user-operator/operator.controller.ts @@ -32,10 +32,10 @@ export class OperatorController { @InjectMapper() private readonly mapper: Mapper, ) {} - @Post('/auth/web3/signup') - @HttpCode(200) @ApiOperation({ summary: 'Operator signup' }) @Public() + @HttpCode(200) + @Post('/auth/web3/signup') async signupOperator( @Body() signupOperatorDto: SignupOperatorDto, ): Promise { @@ -47,10 +47,10 @@ export class OperatorController { return this.service.signupOperator(signupOperatorCommand); } - @Post('/auth/web3/signin') - @HttpCode(200) @ApiOperation({ summary: 'Operator signin' }) @Public() + @HttpCode(200) + @Post('/auth/web3/signin') async signinOperator( @Body() dto: SigninOperatorDto, ): Promise { @@ -62,12 +62,12 @@ export class OperatorController { return this.service.signinOperator(command); } - @Post('/disable-operator') - @HttpCode(200) @ApiOperation({ summary: 'Endpoint to disable an operator', }) @ApiBearerAuth() + @HttpCode(200) + @Post('/disable-operator') async disableOperator( @Body() disableOperatorDto: DisableOperatorDto, @Request() req: RequestWithUser, @@ -81,12 +81,12 @@ export class OperatorController { await this.service.disableOperator(disableOperatorCommand); } - @Post('/enable-operator') - @HttpCode(200) @ApiOperation({ summary: 'Endpoint to enable an operator', }) @ApiBearerAuth() + @HttpCode(200) + @Post('/enable-operator') async enable( @Body() enableOperatorDto: EnableOperatorDto, @Request() req: RequestWithUser, diff --git a/packages/apps/human-app/server/src/modules/user-worker/worker.controller.ts b/packages/apps/human-app/server/src/modules/user-worker/worker.controller.ts index 875c856451..9e3f657410 100644 --- a/packages/apps/human-app/server/src/modules/user-worker/worker.controller.ts +++ b/packages/apps/human-app/server/src/modules/user-worker/worker.controller.ts @@ -1,6 +1,6 @@ import { Mapper } from '@automapper/core'; import { InjectMapper } from '@automapper/nestjs'; -import { Body, Controller, Get, Post, Request } from '@nestjs/common'; +import { Body, Controller, Get, HttpCode, Post, Request } from '@nestjs/common'; import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; import { Public } from '../../common/decorators'; import { RequestWithUser } from '../../common/interfaces/jwt'; @@ -27,10 +27,11 @@ export class WorkerController { @InjectMapper() private readonly mapper: Mapper, ) {} - @Post('/auth/signup') @ApiOperation({ summary: 'Worker signup' }) @Public() - public signupWorker(@Body() signupWorkerDto: SignupWorkerDto): Promise { + @HttpCode(200) + @Post('/auth/signup') + async signupWorker(@Body() signupWorkerDto: SignupWorkerDto): Promise { const signupWorkerCommand = this.mapper.map( signupWorkerDto, SignupWorkerDto, @@ -39,10 +40,11 @@ export class WorkerController { return this.service.signupWorker(signupWorkerCommand); } - @Post('/auth/signin') @ApiOperation({ summary: 'Worker signin' }) @Public() - public signinWorker( + @HttpCode(200) + @Post('/auth/signin') + async signinWorker( @Body() signinWorkerDto: SigninWorkerDto, ): Promise { const signinWorkerCommand = this.mapper.map( @@ -53,10 +55,11 @@ export class WorkerController { return this.service.signinWorker(signinWorkerCommand); } + @ApiOperation({ summary: 'Registers a worker in Exchange Oracle' }) @ApiBearerAuth() + @HttpCode(200) @Post('/exchange-oracle-registration') - @ApiOperation({ summary: 'Registers a worker in Exchange Oracle' }) - public createRegistrationInExchangeOracle( + async createRegistrationInExchangeOracle( @Body() registrationInExchangeOracleDto: RegistrationInExchangeOracleDto, @Request() req: RequestWithUser, @@ -73,10 +76,11 @@ export class WorkerController { ); } + @ApiOperation({ summary: 'Retrieves oracles registered by the worker' }) @ApiBearerAuth() + @HttpCode(200) @Get('/exchange-oracle-registration') - @ApiOperation({ summary: 'Retrieves oracles registered by the worker' }) - public getRegistrationInExchangeOracles( + async getRegistrationInExchangeOracles( @Request() req: RequestWithUser, ): Promise { return this.service.getRegistrationInExchangeOracles(req.token); diff --git a/packages/apps/human-app/server/test/app.e2e-spec.ts b/packages/apps/human-app/server/test/app.e2e-spec.ts deleted file mode 100644 index cead57d7a5..0000000000 --- a/packages/apps/human-app/server/test/app.e2e-spec.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { Test, TestingModule } from '@nestjs/testing'; -import { INestApplication } from '@nestjs/common'; -import request from 'supertest'; -import { AppModule } from '../src/app.module'; -import { generateWorkerSignupRequestBody } from './fixtures/user-worker.fixture'; -import { SignupWorkerData } from '../src/modules/user-worker/model/worker-registration.model'; -import { beforeAll } from '@jest/globals'; -import { generateOperatorSignupRequestBody } from './fixtures/user-operator.fixture'; -import { SignupOperatorData } from '../src/modules/user-operator/model/operator-registration.model'; -import { ConfigService } from '@nestjs/config'; -import { - TestEnvironmentConfigService, - testEnvValidator, -} from '../src/common/config/test-environment-config.service'; - -describe('Human APP (e2e) tests', () => { - let app: INestApplication; - let configService: ConfigService; - let envConfigService: TestEnvironmentConfigService; - - beforeAll(async () => { - const moduleFixture: TestingModule = await Test.createTestingModule({ - imports: [AppModule], - }).compile(); - - app = moduleFixture.createNestApplication(); - configService = moduleFixture.get(ConfigService); - envConfigService = new TestEnvironmentConfigService(configService); - - const { error } = testEnvValidator.validate({ - E2E_TESTING_EMAIL_ADDRESS: envConfigService.e2eTestingEmailAddress, - E2E_TESTING_PASSWORD: envConfigService.e2eTestingPassword, - E2E_TESTING_EXCHANGE_ORACLE_URL: - envConfigService.e2eTestingExchangeOracleUrl, - E2E_TESTING_ESCROW_ADDRESS: envConfigService.e2eTestingEscrowAddress, - E2E_TESTING_ESCROW_CHAIN_ID: envConfigService.e2eTestingEscrowChainId, - }); - - if (error) { - throw new Error(`Test environment is not valid: ${error.message}`); - } - - await app.init(); - }); - - describe('Worker signup', () => { - let requestBodyForWorkerSignup: SignupWorkerData; - beforeAll(async () => { - requestBodyForWorkerSignup = generateWorkerSignupRequestBody(); - }); - - it('should successfully process the signup request for a worker', async () => { - return request(app.getHttpServer()) - .post('/auth/signup') - .send(requestBodyForWorkerSignup) - .expect(201); - }); - - it('should return a 409 Conflict status when processing a duplicate signup request for a worker', async () => { - return request(app.getHttpServer()) - .post('/auth/signup') - .send(requestBodyForWorkerSignup) - .expect(409); - }); - }); - describe('Operator signup', () => { - let requestBodyForOperatorSignup: SignupOperatorData; - beforeAll(async () => { - requestBodyForOperatorSignup = await generateOperatorSignupRequestBody(); - }); - it('should successfully process the signup request for an operator', async () => { - return request(app.getHttpServer()) - .post('/auth/web3/signup') - .send(requestBodyForOperatorSignup) - .expect(201); - }); - - it('should return a 409 Conflict status when processing a duplicate signup request for an operator', async () => { - return request(app.getHttpServer()) - .post('/auth/web3/signup') - .send(requestBodyForOperatorSignup) - .expect(409); - }); - }); - describe('Worker signin', () => { - it('should successfully process the signin request for a worker', async () => { - return request(app.getHttpServer()) - .post('/auth/signin') - .send({ - email: envConfigService.e2eTestingEmailAddress, - password: envConfigService.e2eTestingPassword, - }) - .expect(201) - .expect((res) => { - expect(res.body).toHaveProperty('access_token'); - expect(res.body).toHaveProperty('refresh_token'); - }); - }); - }); - describe('Jobs discovery', () => { - it('should successfully process the jobs discovery request', async () => { - const exchangeOracleUrl = envConfigService.e2eTestingExchangeOracleUrl; - return request(app.getHttpServer()) - .get(`${exchangeOracleUrl}/jobs`) - .expect(200); - }); - }); - describe('Job assignment', () => { - it('should successfully assign a job to a user', async () => { - const exchangeOracleUrl = envConfigService.e2eTestingExchangeOracleUrl; - return request(app.getHttpServer()) - .post(`${exchangeOracleUrl}/assignment`) - .send({ - escrow_address: envConfigService.e2eTestingEscrowAddress, - chain_id: envConfigService.e2eTestingEscrowChainId, - }) - .expect(201); - }); - it('should successfully get jobs assigned to a user', async () => { - const exchangeOracleUrl = envConfigService.e2eTestingExchangeOracleUrl; - return request(app.getHttpServer()) - .get(`${exchangeOracleUrl}/assignment`) - .query({}) - .expect(200); - }); - }); - - afterAll(async () => { - await app.close(); - }); -}); diff --git a/packages/apps/human-app/server/test/fixtures/user-operator.fixture.ts b/packages/apps/human-app/server/test/fixtures/user-operator.fixture.ts deleted file mode 100644 index da24772ed2..0000000000 --- a/packages/apps/human-app/server/test/fixtures/user-operator.fixture.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { UserType } from '../../src/common/enums/user'; -import { ethers } from 'ethers'; -import { SignupOperatorData } from '../../src/modules/user-operator/model/operator-registration.model'; -export async function generateOperatorSignupRequestBody() { - const wallet = ethers.Wallet.createRandom(); - const flatSig = await wallet.signMessage('signup'); - return { - address: wallet.address, - signature: flatSig, - type: UserType.OPERATOR.toString(), - } as SignupOperatorData; -} diff --git a/packages/apps/human-app/server/test/fixtures/user-worker.fixture.ts b/packages/apps/human-app/server/test/fixtures/user-worker.fixture.ts deleted file mode 100644 index 7e4098fdac..0000000000 --- a/packages/apps/human-app/server/test/fixtures/user-worker.fixture.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { UserType } from '../../src/common/enums/user'; - -export function generateWorkerSignupRequestBody() { - const randomElement = Math.floor(Math.random() * 1000); - return { - email: `john_doe${randomElement}@example.com`, - password: 'v3ry57r0n9P455w0r[)!', - h_captcha_token: '342dsfgisg8932resadz231y58sdf9adsf', - type: UserType.WORKER.toString(), - }; -} diff --git a/packages/apps/human-app/server/test/jest-e2e.json b/packages/apps/human-app/server/test/jest-e2e.json deleted file mode 100644 index d530a8f8d9..0000000000 --- a/packages/apps/human-app/server/test/jest-e2e.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "moduleFileExtensions": ["js", "json", "ts"], - "rootDir": ".", - "testEnvironment": "node", - "testRegex": ".e2e-spec.ts$", - "transform": { - "^.+\\.(t|j)s$": "ts-jest" - }, - "transformIgnorePatterns": [ - "/node_modules/(?!(@nestjs/config|uuid)).+\\.js$" - ] -} diff --git a/packages/apps/job-launcher/server/package.json b/packages/apps/job-launcher/server/package.json index 24418f485e..59e7c88ed6 100644 --- a/packages/apps/job-launcher/server/package.json +++ b/packages/apps/job-launcher/server/package.json @@ -82,7 +82,6 @@ "@types/express": "^4.17.13", "@types/jest": "29.5.12", "@types/node": "22.10.5", - "@types/supertest": "^6.0.2", "@types/xml2js": "0.4.14", "@types/zxcvbn": "4.4.5", "@typescript-eslint/eslint-plugin": "^5.0.0", @@ -93,7 +92,6 @@ "jest": "29.7.0", "prettier": "^3.4.2", "source-map-support": "^0.5.20", - "supertest": "^7.0.0", "ts-jest": "29.2.5", "ts-node": "^10.9.2", "tsconfig-paths": "4.2.0", diff --git a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts index 60e4b5b3f2..189219355e 100644 --- a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts @@ -50,7 +50,9 @@ export class ExceptionFilter implements IExceptionFilter { const status = this.getStatus(exception); const message = exception.message || 'Internal server error'; - this.logger.error('Unhandled exception', exception); + if (status === HttpStatus.INTERNAL_SERVER_ERROR) { + this.logger.error('Unhandled exception', exception); + } response.removeHeader('Cache-Control'); diff --git a/packages/apps/job-launcher/server/src/modules/mutex/mutex-manager.service.ts b/packages/apps/job-launcher/server/src/modules/mutex/mutex-manager.service.ts index 30b0e50a76..69b9d46302 100644 --- a/packages/apps/job-launcher/server/src/modules/mutex/mutex-manager.service.ts +++ b/packages/apps/job-launcher/server/src/modules/mutex/mutex-manager.service.ts @@ -1,6 +1,6 @@ import { Injectable, OnModuleDestroy } from '@nestjs/common'; import { E_TIMEOUT, Mutex, MutexInterface, withTimeout } from 'async-mutex'; -import { ServerError } from '../../common/errors'; +import { BaseError, ServerError } from '../../common/errors'; import logger from '../../logger'; @Injectable() @@ -63,14 +63,19 @@ export class MutexManagerService implements OnModuleDestroy { }); return result; - } catch (e) { - if (e === E_TIMEOUT) { + } catch (error) { + if (error === E_TIMEOUT) { const errorMessage = 'Function execution timed out for key'; this.logger.error(errorMessage, { key }); - throw new Error(errorMessage); + throw new ServerError(errorMessage); } + + if (error instanceof BaseError) { + throw error; + } + const errorMessage = 'Function execution failed for key'; - this.logger.error(errorMessage, { key }); + this.logger.error(errorMessage, { key, error }); throw new ServerError(errorMessage); } } diff --git a/packages/apps/reputation-oracle/server/package.json b/packages/apps/reputation-oracle/server/package.json index b65830eb7e..1007b36f74 100644 --- a/packages/apps/reputation-oracle/server/package.json +++ b/packages/apps/reputation-oracle/server/package.json @@ -81,7 +81,6 @@ "@types/jest": "29.5.12", "@types/lodash": "^4.17.14", "@types/node": "22.10.5", - "@types/supertest": "^6.0.2", "@types/uuid": "^10.0.0", "@types/zxcvbn": "4.4.5", "@typescript-eslint/eslint-plugin": "^5.0.0", @@ -93,7 +92,6 @@ "nock": "^14.0.3", "prettier": "^3.4.2", "source-map-support": "^0.5.20", - "supertest": "^7.0.0", "ts-jest": "29.2.5", "ts-node": "^10.9.2", "tsconfig-paths": "4.2.0", diff --git a/yarn.lock b/yarn.lock index da438a1e05..afc996370e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4017,7 +4017,6 @@ __metadata: "@types/express": "npm:^4.17.13" "@types/jest": "npm:29.5.1" "@types/node": "npm:22.10.5" - "@types/supertest": "npm:^2.0.11" "@typescript-eslint/eslint-plugin": "npm:^5.0.0" "@typescript-eslint/parser": "npm:^5.0.0" axios: "npm:^1.3.1" @@ -4034,7 +4033,6 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.2.0" source-map-support: "npm:^0.5.20" - supertest: "npm:^7.0.0" ts-jest: "npm:29.2.5" ts-node: "npm:^10.0.0" tsconfig-paths: "npm:4.2.0" @@ -4158,7 +4156,6 @@ __metadata: "@types/passport": "npm:^0" "@types/passport-jwt": "npm:^4.0.1" "@types/pg": "npm:8.11.10" - "@types/supertest": "npm:^6.0.2" "@typescript-eslint/eslint-plugin": "npm:^5.0.0" "@typescript-eslint/parser": "npm:^5.0.0" axios: "npm:^1.3.1" @@ -4181,7 +4178,6 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.2.0" source-map-support: "npm:^0.5.20" - supertest: "npm:^7.0.0" ts-jest: "npm:29.2.5" ts-node: "npm:^10.9.2" tsconfig-paths: "npm:4.2.0" @@ -4325,7 +4321,6 @@ __metadata: "@types/node": "npm:22.10.5" "@types/passport": "npm:^0" "@types/passport-jwt": "npm:^4.0.1" - "@types/supertest": "npm:^2.0.15" "@typescript-eslint/eslint-plugin": "npm:^5.0.0" "@typescript-eslint/parser": "npm:^5.0.0" axios: "npm:^1.7.2" @@ -4349,7 +4344,6 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.2.0" source-map-support: "npm:^0.5.20" - supertest: "npm:^7.0.0" ts-jest: "npm:29.2.5" ts-node: "npm:^10.9.2" tsconfig-paths: "npm:4.2.0" @@ -4446,7 +4440,6 @@ __metadata: "@types/jest": "npm:29.5.12" "@types/node": "npm:22.10.5" "@types/passport-jwt": "npm:^4.0.1" - "@types/supertest": "npm:^6.0.2" "@types/uuid": "npm:^10.0.0" "@types/xml2js": "npm:0.4.14" "@types/zxcvbn": "npm:4.4.5" @@ -4478,7 +4471,6 @@ __metadata: rxjs: "npm:^7.2.0" source-map-support: "npm:^0.5.20" stripe: "npm:^17.7.0" - supertest: "npm:^7.0.0" ts-jest: "npm:29.2.5" ts-node: "npm:^10.9.2" tsconfig-paths: "npm:4.2.0" @@ -4545,7 +4537,6 @@ __metadata: "@types/lodash": "npm:^4.17.14" "@types/node": "npm:22.10.5" "@types/passport-jwt": "npm:^4.0.1" - "@types/supertest": "npm:^6.0.2" "@types/uuid": "npm:^10.0.0" "@types/zxcvbn": "npm:4.4.5" "@typescript-eslint/eslint-plugin": "npm:^5.0.0" @@ -4574,7 +4565,6 @@ __metadata: reflect-metadata: "npm:^0.2.2" rxjs: "npm:^7.2.0" source-map-support: "npm:^0.5.20" - supertest: "npm:^7.0.0" ts-jest: "npm:29.2.5" ts-node: "npm:^10.9.2" tsconfig-paths: "npm:4.2.0" @@ -6883,7 +6873,7 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.1.5, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:^1.5.0, @noble/hashes@npm:^1.6.1, @noble/hashes@npm:^1.8.0, @noble/hashes@npm:~1.8.0": +"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:^1.5.0, @noble/hashes@npm:^1.6.1, @noble/hashes@npm:^1.8.0, @noble/hashes@npm:~1.8.0": version: 1.8.0 resolution: "@noble/hashes@npm:1.8.0" checksum: 10c0/06a0b52c81a6fa7f04d67762e08b2c476a00285858150caeaaff4037356dd5e119f45b2a530f638b77a5eeca013168ec1b655db41bae3236cb2e9d511484fc77 @@ -7497,15 +7487,6 @@ __metadata: languageName: node linkType: hard -"@paralleldrive/cuid2@npm:^2.2.2": - version: 2.2.2 - resolution: "@paralleldrive/cuid2@npm:2.2.2" - dependencies: - "@noble/hashes": "npm:^1.1.5" - checksum: 10c0/af5826df93de437121308f4f4ce0b2eeb89b60bb57a1a6592fb89c0d40d311ad1d9f3f6a4db2cce6f2bcf572de1aa3f85704254e89b18ce61c41ebb06564c4ee - languageName: node - linkType: hard - "@parcel/watcher-android-arm64@npm:2.5.1": version: 2.5.1 resolution: "@parcel/watcher-android-arm64@npm:2.5.1" @@ -10077,13 +10058,6 @@ __metadata: languageName: node linkType: hard -"@types/cookiejar@npm:^2.1.5": - version: 2.1.5 - resolution: "@types/cookiejar@npm:2.1.5" - checksum: 10c0/af38c3d84aebb3ccc6e46fb6afeeaac80fb26e63a487dd4db5a8b87e6ad3d4b845ba1116b2ae90d6f886290a36200fa433d8b1f6fe19c47da6b81872ce9a2764 - languageName: node - linkType: hard - "@types/cors@npm:^2.8.19": version: 2.8.19 resolution: "@types/cors@npm:2.8.19" @@ -10435,13 +10409,6 @@ __metadata: languageName: node linkType: hard -"@types/methods@npm:^1.1.4": - version: 1.1.4 - resolution: "@types/methods@npm:1.1.4" - checksum: 10c0/a78534d79c300718298bfff92facd07bf38429c66191f640c1db4c9cff1e36f819304298a96f7536b6512bfc398e5c3e6b831405e138cd774b88ad7be78d682a - languageName: node - linkType: hard - "@types/mime@npm:^1": version: 1.3.5 resolution: "@types/mime@npm:1.3.5" @@ -10767,37 +10734,6 @@ __metadata: languageName: node linkType: hard -"@types/superagent@npm:*, @types/superagent@npm:^8.1.0": - version: 8.1.9 - resolution: "@types/superagent@npm:8.1.9" - dependencies: - "@types/cookiejar": "npm:^2.1.5" - "@types/methods": "npm:^1.1.4" - "@types/node": "npm:*" - form-data: "npm:^4.0.0" - checksum: 10c0/12631f1d8b3a62e1f435bc885f6d64d1a2d1ae82b80f0c6d63d4d6372c40b6f1fee6b3da59ac18bb86250b1eb73583bf2d4b1f7882048c32468791c560c69b7c - languageName: node - linkType: hard - -"@types/supertest@npm:^2.0.11, @types/supertest@npm:^2.0.15": - version: 2.0.16 - resolution: "@types/supertest@npm:2.0.16" - dependencies: - "@types/superagent": "npm:*" - checksum: 10c0/e1b4a4d788c19cd92a3f2e6d0979fb0f679c49aefae2011895a4d9c35aa960d43463aca8783a0b3382bbf0b4eb7ceaf8752d7dc80b8f5a9644fa14e1b1bdbc90 - languageName: node - linkType: hard - -"@types/supertest@npm:^6.0.2": - version: 6.0.3 - resolution: "@types/supertest@npm:6.0.3" - dependencies: - "@types/methods": "npm:^1.1.4" - "@types/superagent": "npm:^8.1.0" - checksum: 10c0/a2080f870154b09db123864a484fb633bc9e2a0f7294a194388df4c7effe5af9de36d5a5ebf819f72b404fa47b5e813c47d5a3a51354251fd2fa8589bfb64f2c - languageName: node - linkType: hard - "@types/tough-cookie@npm:*": version: 4.0.5 resolution: "@types/tough-cookie@npm:4.0.5" @@ -13720,13 +13656,6 @@ __metadata: languageName: node linkType: hard -"asap@npm:^2.0.0": - version: 2.0.6 - resolution: "asap@npm:2.0.6" - checksum: 10c0/c6d5e39fe1f15e4b87677460bd66b66050cd14c772269cee6688824c1410a08ab20254bb6784f9afb75af9144a9f9a7692d49547f4d19d715aeb7c0318f3136d - languageName: node - linkType: hard - "asn1.js@npm:^4.10.1": version: 4.10.1 resolution: "asn1.js@npm:4.10.1" @@ -15464,13 +15393,6 @@ __metadata: languageName: node linkType: hard -"component-emitter@npm:^1.3.0": - version: 1.3.1 - resolution: "component-emitter@npm:1.3.1" - checksum: 10c0/e4900b1b790b5e76b8d71b328da41482118c0f3523a516a41be598dc2785a07fd721098d9bf6e22d89b19f4fa4e1025160dc00317ea111633a3e4f75c2b86032 - languageName: node - linkType: hard - "compressible@npm:~2.0.16": version: 2.0.18 resolution: "compressible@npm:2.0.18" @@ -15665,13 +15587,6 @@ __metadata: languageName: node linkType: hard -"cookiejar@npm:^2.1.4": - version: 2.1.4 - resolution: "cookiejar@npm:2.1.4" - checksum: 10c0/2dae55611c6e1678f34d93984cbd4bda58f4fe3e5247cc4993f4a305cd19c913bbaf325086ed952e892108115073a747596453d3dc1c34947f47f731818b8ad1 - languageName: node - linkType: hard - "copy-to-clipboard@npm:^3.3.3": version: 3.3.3 resolution: "copy-to-clipboard@npm:3.3.3" @@ -16504,16 +16419,6 @@ __metadata: languageName: node linkType: hard -"dezalgo@npm:^1.0.4": - version: 1.0.4 - resolution: "dezalgo@npm:1.0.4" - dependencies: - asap: "npm:^2.0.0" - wrappy: "npm:1" - checksum: 10c0/8a870ed42eade9a397e6141fe5c025148a59ed52f1f28b1db5de216b4d57f0af7a257070c3af7ce3d5508c1ce9dd5009028a76f4b2cc9370dc56551d2355fad8 - languageName: node - linkType: hard - "diff-sequences@npm:^29.6.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" @@ -19050,17 +18955,6 @@ __metadata: languageName: node linkType: hard -"formidable@npm:^3.5.1": - version: 3.5.4 - resolution: "formidable@npm:3.5.4" - dependencies: - "@paralleldrive/cuid2": "npm:^2.2.2" - dezalgo: "npm:^1.0.4" - once: "npm:^1.4.0" - checksum: 10c0/3a311ce57617eb8f532368e91c0f2bbfb299a0f1a35090e085bd6ca772298f196fbb0b66f0d4b5549d7bf3c5e1844439338d4402b7b6d1fedbe206ad44a931f8 - languageName: node - linkType: hard - "formik@npm:^2.4.2": version: 2.4.6 resolution: "formik@npm:2.4.6" @@ -23221,7 +23115,7 @@ __metadata: languageName: node linkType: hard -"methods@npm:^1.1.2, methods@npm:~1.1.2": +"methods@npm:~1.1.2": version: 1.1.2 resolution: "methods@npm:1.1.2" checksum: 10c0/bdf7cc72ff0a33e3eede03708c08983c4d7a173f91348b4b1e4f47d4cdbf734433ad971e7d1e8c77247d9e5cd8adb81ea4c67b0a2db526b758b2233d7814b8b2 @@ -23334,15 +23228,6 @@ __metadata: languageName: node linkType: hard -"mime@npm:2.6.0": - version: 2.6.0 - resolution: "mime@npm:2.6.0" - bin: - mime: cli.js - checksum: 10c0/a7f2589900d9c16e3bdf7672d16a6274df903da958c1643c9c45771f0478f3846dcb1097f31eb9178452570271361e2149310931ec705c037210fc69639c8e6c - languageName: node - linkType: hard - "mime@npm:^3.0.0": version: 3.0.0 resolution: "mime@npm:3.0.0" @@ -28302,23 +28187,6 @@ __metadata: languageName: node linkType: hard -"superagent@npm:^9.0.1": - version: 9.0.2 - resolution: "superagent@npm:9.0.2" - dependencies: - component-emitter: "npm:^1.3.0" - cookiejar: "npm:^2.1.4" - debug: "npm:^4.3.4" - fast-safe-stringify: "npm:^2.1.1" - form-data: "npm:^4.0.0" - formidable: "npm:^3.5.1" - methods: "npm:^1.1.2" - mime: "npm:2.6.0" - qs: "npm:^6.11.0" - checksum: 10c0/bfe7522ce9554552bed03c0e71949038e54626dd7be627f1033d92aae5b46d90afc42f8fc0dcda481eebf371a30b702414e438ea51251be6ab7bfbd60086d147 - languageName: node - linkType: hard - "superstruct@npm:^1.0.3": version: 1.0.4 resolution: "superstruct@npm:1.0.4" @@ -28326,16 +28194,6 @@ __metadata: languageName: node linkType: hard -"supertest@npm:^7.0.0": - version: 7.1.0 - resolution: "supertest@npm:7.1.0" - dependencies: - methods: "npm:^1.1.2" - superagent: "npm:^9.0.1" - checksum: 10c0/7a711630b5895c86978980fc88db0b6e54a655424d47e83bb126ff13d3879130271c37bca5e1f404c9ce8cbcaa922ab0897f3955598c3d5bb0dc6914161221bc - languageName: node - linkType: hard - "supports-color@npm:^3.1.0": version: 3.2.3 resolution: "supports-color@npm:3.2.3" From de88fe5d7d649d9a0ebcaebb713511426bd4372a Mon Sep 17 00:00:00 2001 From: Dmitry Nechay Date: Fri, 8 Aug 2025 17:39:14 +0300 Subject: [PATCH 12/14] [HUMAN App] fix: format all potential axios errors (#3498) --- .../server/src/common/filter/exceptions.filter.ts | 4 ++-- .../interceptors/axios-request.interceptor.ts | 6 +++--- .../server/src/common/utils/{http.ts => error.ts} | 6 ++---- .../exchange-oracle/exchange-oracle.gateway.ts | 4 ++-- .../h-captcha-labeling/h-captcha-verify.gateway.ts | 4 ++-- .../src/modules/cron-job/cron-job.service.ts | 14 ++++++++++++-- 6 files changed, 23 insertions(+), 15 deletions(-) rename packages/apps/human-app/server/src/common/utils/{http.ts => error.ts} (56%) diff --git a/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts b/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts index 6f61fed29a..68f48dc675 100644 --- a/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts +++ b/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts @@ -7,7 +7,7 @@ import { } from '@nestjs/common'; import logger from '../../logger'; import { AxiosError } from 'axios'; -import * as httpUtils from '../utils/http'; +import * as errorUtils from '../utils/error'; @Catch() export class ExceptionFilter implements IExceptionFilter { @@ -30,7 +30,7 @@ export class ExceptionFilter implements IExceptionFilter { } else { let formattedError = exception; if (exception instanceof AxiosError) { - formattedError = httpUtils.formatAxiosError(exception); + formattedError = errorUtils.formatError(exception); } this.logger.error('Unhandled exception', formattedError); } diff --git a/packages/apps/human-app/server/src/common/interceptors/axios-request.interceptor.ts b/packages/apps/human-app/server/src/common/interceptors/axios-request.interceptor.ts index 7fb5adc0af..e8573fc366 100644 --- a/packages/apps/human-app/server/src/common/interceptors/axios-request.interceptor.ts +++ b/packages/apps/human-app/server/src/common/interceptors/axios-request.interceptor.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import axios from 'axios'; -import * as httpUtils from '../../common/utils/http'; +import * as errorUtils from '../utils/error'; import logger from '../../logger'; // This interceptor injection is guarded via IS_AXIOS_REQUEST_LOGGING_ENABLED environment variable. @@ -29,7 +29,7 @@ export class AxiosRequestInterceptor { }, (error) => { this.logger.error('Request error', { - error: httpUtils.formatAxiosError(error), + error: errorUtils.formatError(error), }); return Promise.reject(error); }, @@ -39,7 +39,7 @@ export class AxiosRequestInterceptor { (response) => response, (error) => { this.logger.error('Response error', { - error: httpUtils.formatAxiosError(error), + error: errorUtils.formatError(error), }); return Promise.reject(error); }, diff --git a/packages/apps/human-app/server/src/common/utils/http.ts b/packages/apps/human-app/server/src/common/utils/error.ts similarity index 56% rename from packages/apps/human-app/server/src/common/utils/http.ts rename to packages/apps/human-app/server/src/common/utils/error.ts index 6c4fb2b45b..72feb3e66c 100644 --- a/packages/apps/human-app/server/src/common/utils/http.ts +++ b/packages/apps/human-app/server/src/common/utils/error.ts @@ -1,10 +1,8 @@ -import { AxiosError } from 'axios'; - -export function formatAxiosError(error: AxiosError) { +export function formatError(error: Error) { return { name: error.name, + message: error.message, stack: error.stack, cause: error.cause, - message: error.message, }; } diff --git a/packages/apps/human-app/server/src/integrations/exchange-oracle/exchange-oracle.gateway.ts b/packages/apps/human-app/server/src/integrations/exchange-oracle/exchange-oracle.gateway.ts index 3654e3a3bf..cb4ff2df89 100644 --- a/packages/apps/human-app/server/src/integrations/exchange-oracle/exchange-oracle.gateway.ts +++ b/packages/apps/human-app/server/src/integrations/exchange-oracle/exchange-oracle.gateway.ts @@ -6,7 +6,7 @@ import { AxiosRequestConfig } from 'axios'; import { lastValueFrom } from 'rxjs'; import { HttpMethod } from '../../common/enums/http-method'; import { toCleanObjParams } from '../../common/utils/gateway-common.utils'; -import * as httpUtils from '../../common/utils/http'; +import * as errorUtils from '../../common/utils/error'; import logger from '../../logger'; import { JobAssignmentCommand, @@ -65,7 +65,7 @@ export class ExchangeOracleGateway { url: options.url, method: options.method, data: options.data, - error: httpUtils.formatAxiosError(error), + error: errorUtils.formatError(error), }); throw error; } diff --git a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-verify.gateway.ts b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-verify.gateway.ts index ba4409463a..93bcf0efbc 100644 --- a/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-verify.gateway.ts +++ b/packages/apps/human-app/server/src/integrations/h-captcha-labeling/h-captcha-verify.gateway.ts @@ -12,7 +12,7 @@ import { } from '../../common/interfaces/endpoint.interface'; import { toCleanObjParams } from '../../common/utils/gateway-common.utils'; import logger from '../../logger'; -import * as httpUtils from '../../common/utils/http'; +import * as errorUtils from '../../common/utils/error'; import { VerifyTokenApiResponse, VerifyTokenCommand, @@ -80,7 +80,7 @@ export class HCaptchaVerifyGateway { return response.data; } catch (error) { this.logger.error('Error while sending hCaptcha token for verification', { - error: httpUtils.formatAxiosError(error), + error: errorUtils.formatError(error), }); } } diff --git a/packages/apps/human-app/server/src/modules/cron-job/cron-job.service.ts b/packages/apps/human-app/server/src/modules/cron-job/cron-job.service.ts index b5fc8ae2f0..05cea18173 100644 --- a/packages/apps/human-app/server/src/modules/cron-job/cron-job.service.ts +++ b/packages/apps/human-app/server/src/modules/cron-job/cron-job.service.ts @@ -1,11 +1,13 @@ import { Injectable } from '@nestjs/common'; import { SchedulerRegistry } from '@nestjs/schedule'; +import { AxiosError } from 'axios'; import { CronJob } from 'cron'; import { EnvironmentConfigService } from '../../common/config/environment-config.service'; import { JobDiscoveryFieldName, JobStatus, } from '../../common/enums/global-common'; +import * as errorUtils from '../../common/utils/error'; import { ExchangeOracleGateway } from '../../integrations/exchange-oracle/exchange-oracle.gateway'; import { ReputationOracleGateway } from '../../integrations/reputation-oracle/reputation-oracle.gateway'; import logger from '../../logger'; @@ -101,7 +103,11 @@ export class CronJobService { ); } } catch (error) { - this.logger.error('Error in update jobs list job', error); + let formattedError = error; + if (error instanceof AxiosError) { + formattedError = errorUtils.formatError(error); + } + this.logger.error('Error in update jobs list job', formattedError); } this.logger.info('Update jobs list END'); @@ -156,10 +162,14 @@ export class CronJobService { await this.jobsDiscoveryService.setCachedJobs(oracle.address, allResults); } catch (error) { + let formattedError = error; + if (error instanceof AxiosError) { + formattedError = errorUtils.formatError(error); + } this.logger.error('Error while updating jobs list for oracle', { chainId: oracle.chainId, address: oracle.address, - error, + error: formattedError, }); await this.handleJobListError(oracle); } From 067c4735afd084f4d5feb4148d11dfbee5fcdf87 Mon Sep 17 00:00:00 2001 From: Dmitry Nechay Date: Mon, 11 Aug 2025 13:14:01 +0300 Subject: [PATCH 13/14] [Job Launcher] fix: do not log non-5xx errors (#3499) --- .../server/src/common/exceptions/exception.filter.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts index 189219355e..c6e34256b9 100644 --- a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts @@ -36,10 +36,11 @@ export class ExceptionFilter implements IExceptionFilter { return HttpStatus.UNPROCESSABLE_ENTITY; } else if (exception instanceof DatabaseError) { return HttpStatus.UNPROCESSABLE_ENTITY; - } else if (exception.statusCode) { - return exception.statusCode; } - return HttpStatus.INTERNAL_SERVER_ERROR; + + const exceptionStatusCode = exception.statusCode || exception.status; + + return exceptionStatusCode || HttpStatus.INTERNAL_SERVER_ERROR; } catch(exception: any, host: ArgumentsHost) { From 7dd900d582ec79a67362493f58592f2f715dfe0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= <50665615+flopez7@users.noreply.github.com> Date: Tue, 12 Aug 2025 16:09:58 +0200 Subject: [PATCH 14/14] [SDK] Allow manifest to be a json string (#3479) Co-authored-by: portuu3 --- .../python/human_protocol_sdk.constants.md | 2 + .../python/human_protocol_sdk.decorators.md | 9 ++ ...human_protocol_sdk.escrow.escrow_client.md | 34 +++---- .../human_protocol_sdk.escrow.escrow_utils.md | 6 +- docs/sdk/python/human_protocol_sdk.escrow.md | 2 +- docs/sdk/python/human_protocol_sdk.filter.md | 2 +- docs/sdk/python/human_protocol_sdk.md | 2 + docs/sdk/python/human_protocol_sdk.utils.md | 8 ++ docs/sdk/python/index.md | 1 + .../base/classes/BaseEthersClient.md | 8 +- .../encryption/classes/Encryption.md | 12 +-- .../encryption/classes/EncryptionUtils.md | 12 +-- .../typescript/enums/enumerations/ChainId.md | 26 ++++-- .../enums/enumerations/OperatorCategory.md | 6 +- .../enums/enumerations/OrderDirection.md | 6 +- .../typescript/escrow/classes/EscrowClient.md | 76 +++++++-------- .../typescript/escrow/classes/EscrowUtils.md | 14 +-- .../types/type-aliases/DailyEscrowData.md | 14 +-- .../types/type-aliases/DailyHMTData.md | 12 +-- .../types/type-aliases/DailyPaymentData.md | 10 +- .../types/type-aliases/DailyTaskData.md | 8 +- .../types/type-aliases/DailyWorkerData.md | 6 +- .../graphql/types/type-aliases/EscrowData.md | 40 ++++---- .../types/type-aliases/EscrowStatistics.md | 6 +- .../type-aliases/EscrowStatisticsData.md | 22 ++--- .../types/type-aliases/EventDayData.md | 38 ++++---- .../graphql/types/type-aliases/HMTHolder.md | 6 +- .../types/type-aliases/HMTHolderData.md | 6 +- .../types/type-aliases/HMTStatistics.md | 8 +- .../types/type-aliases/HMTStatisticsData.md | 14 +-- .../graphql/types/type-aliases/IMData.md | 2 +- .../types/type-aliases/IMDataEntity.md | 6 +- .../graphql/types/type-aliases/KVStoreData.md | 14 +-- .../types/type-aliases/PaymentStatistics.md | 4 +- .../type-aliases/RewardAddedEventData.md | 10 +- .../graphql/types/type-aliases/StatusEvent.md | 10 +- .../types/type-aliases/TaskStatistics.md | 4 +- .../types/type-aliases/WorkerStatistics.md | 4 +- .../interfaces/interfaces/IEscrow.md | 48 +++++----- .../interfaces/interfaces/IEscrowConfig.md | 26 +++--- .../interfaces/interfaces/IEscrowsFilter.md | 28 +++--- .../interfaces/IHMTHoldersParams.md | 10 +- .../interfaces/interfaces/IKVStore.md | 6 +- .../interfaces/interfaces/IKeyPair.md | 10 +- .../interfaces/interfaces/IOperator.md | 46 +++++----- .../interfaces/IOperatorSubgraph.md | 44 ++++----- .../interfaces/interfaces/IOperatorsFilter.md | 16 ++-- .../interfaces/interfaces/IPagination.md | 8 +- .../interfaces/interfaces/IPayoutFilter.md | 18 ++-- .../interfaces/IReputationNetwork.md | 8 +- .../interfaces/IReputationNetworkSubgraph.md | 8 +- .../interfaces/interfaces/IReward.md | 6 +- .../interfaces/IStatisticsFilter.md | 12 +-- .../interfaces/IStatusEventFilter.md | 18 ++-- .../interfaces/interfaces/ITransaction.md | 24 ++--- .../interfaces/ITransactionsFilter.md | 28 +++--- .../interfaces/interfaces/IWorker.md | 10 +- .../interfaces/interfaces/IWorkersFilter.md | 14 +-- .../interfaces/InternalTransaction.md | 16 ++-- .../interfaces/interfaces/StakerInfo.md | 10 +- .../kvstore/classes/KVStoreClient.md | 16 ++-- .../kvstore/classes/KVStoreUtils.md | 10 +- .../operator/classes/OperatorUtils.md | 10 +- .../staking/classes/StakingClient.md | 28 +++--- .../statistics/classes/StatisticsClient.md | 20 ++-- .../storage/classes/StorageClient.md | 14 +-- .../transaction/classes/TransactionUtils.md | 6 +- .../types/enumerations/EscrowStatus.md | 14 +-- .../types/type-aliases/EscrowCancel.md | 6 +- .../types/type-aliases/EscrowWithdraw.md | 8 +- .../types/type-aliases/NetworkData.md | 24 ++--- .../typescript/types/type-aliases/Payout.md | 12 +-- .../types/type-aliases/StorageCredentials.md | 6 +- .../types/type-aliases/StorageParams.md | 10 +- .../type-aliases/TransactionLikeWithNonce.md | 2 +- .../types/type-aliases/UploadFile.md | 8 +- .../src/modules/job/job.service.spec.ts | 2 +- .../server/src/modules/job/job.service.ts | 2 +- .../src/modules/job/job.service.spec.ts | 36 ++------ .../src/modules/job/job.service.ts | 4 +- .../src/modules/job/job.service.spec.ts | 2 +- .../server/src/modules/job/job.service.ts | 2 +- .../server/src/modules/abuse/abuse.service.ts | 2 +- .../escrow-completion.service.spec.ts | 4 +- .../escrow-completion.service.ts | 2 +- .../docs/human_protocol_sdk.decorators.rst | 7 ++ .../human_protocol_sdk/constants.py | 14 +-- .../escrow/escrow_client.py | 21 +++-- .../human_protocol_sdk/escrow/escrow_utils.py | 10 +- .../human_protocol_sdk/gql/escrow.py | 2 +- .../human_protocol_sdk/utils.py | 12 +++ .../escrow/test_escrow_client.py | 88 ++++++++++++++---- .../escrow/test_escrow_utils.py | 4 +- .../human-protocol-sdk/src/constants.ts | 14 +-- .../human-protocol-sdk/src/error.ts | 4 +- .../human-protocol-sdk/src/escrow.ts | 32 +++---- .../src/graphql/queries/escrow.ts | 2 +- .../human-protocol-sdk/src/interfaces.ts | 4 +- .../human-protocol-sdk/src/utils.ts | 15 +++ .../human-protocol-sdk/test/escrow.test.ts | 92 ++++++++++++------- .../sdk/typescript/subgraph/schema.graphql | 2 +- .../subgraph/src/mapping/EscrowTemplate.ts | 4 +- .../subgraph/src/mapping/legacy/Escrow.ts | 2 +- .../subgraph/tests/escrow/escrow.test.ts | 8 +- .../tests/legacy/escrow/escrow.test.ts | 2 +- 105 files changed, 795 insertions(+), 678 deletions(-) create mode 100644 docs/sdk/python/human_protocol_sdk.decorators.md create mode 100644 packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.decorators.rst diff --git a/docs/sdk/python/human_protocol_sdk.constants.md b/docs/sdk/python/human_protocol_sdk.constants.md index f93dcb051f..fe660c84fe 100644 --- a/docs/sdk/python/human_protocol_sdk.constants.md +++ b/docs/sdk/python/human_protocol_sdk.constants.md @@ -6,6 +6,8 @@ Bases: `Enum` Enum for chain IDs. +#### AURORA_TESTNET *= 1313161555* + #### BSC_MAINNET *= 56* #### BSC_TESTNET *= 97* diff --git a/docs/sdk/python/human_protocol_sdk.decorators.md b/docs/sdk/python/human_protocol_sdk.decorators.md new file mode 100644 index 0000000000..52567ed450 --- /dev/null +++ b/docs/sdk/python/human_protocol_sdk.decorators.md @@ -0,0 +1,9 @@ +# human_protocol_sdk.decorators module + +### *exception* human_protocol_sdk.decorators.RequiresSignerError + +Bases: `Exception` + +Raised when a signer or required middleware is missing in the Web3 instance. + +### human_protocol_sdk.decorators.requires_signer(method) 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 2d067904ba..4daa504709 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md @@ -318,16 +318,14 @@ Gets the job launcher address of the escrow. ) ``` -#### get_manifest_hash(escrow_address) +#### get_manifest(escrow_address) -Gets the manifest file hash. +Gets the manifest data (can be a URL or JSON string). * **Parameters:** **escrow_address** (`str`) – Address of the escrow -* **Return type:** - `str` -* **Returns:** - Manifest file hash +* **Return str:** + Manifest data * **Raises:** [**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an error occurs while checking the parameters * **Example:** @@ -341,19 +339,23 @@ Gets the manifest file hash. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) escrow_client = EscrowClient(w3) - manifest_hash = escrow_client.get_manifest_hash( + manifest = escrow_client.get_manifest( "0x62dD51230A30401C455c8398d06F85e4EaB6309f" ) ``` +* **Return type:** + `str` -#### get_manifest_url(escrow_address) +#### get_manifest_hash(escrow_address) -Gets the manifest file URL. +Gets the manifest file hash. * **Parameters:** **escrow_address** (`str`) – Address of the escrow -* **Return str:** - Manifest file url +* **Return type:** + `str` +* **Returns:** + Manifest file hash * **Raises:** [**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an error occurs while checking the parameters * **Example:** @@ -367,12 +369,10 @@ Gets the manifest file URL. w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) escrow_client = EscrowClient(w3) - url = escrow_client.get_manifest_url( + manifest_hash = escrow_client.get_manifest_hash( "0x62dD51230A30401C455c8398d06F85e4EaB6309f" ) ``` -* **Return type:** - `str` #### get_recording_oracle_address(escrow_address) @@ -526,13 +526,13 @@ Bases: `Exception` Raises when some error happens when interacting with escrow. -### *class* human_protocol_sdk.escrow.escrow_client.EscrowConfig(recording_oracle_address, reputation_oracle_address, exchange_oracle_address, recording_oracle_fee, reputation_oracle_fee, exchange_oracle_fee, manifest_url, hash) +### *class* human_protocol_sdk.escrow.escrow_client.EscrowConfig(recording_oracle_address, reputation_oracle_address, exchange_oracle_address, recording_oracle_fee, reputation_oracle_fee, exchange_oracle_fee, manifest, hash) Bases: `object` A class used to manage escrow parameters. -#### \_\_init_\_(recording_oracle_address, reputation_oracle_address, exchange_oracle_address, recording_oracle_fee, reputation_oracle_fee, exchange_oracle_fee, manifest_url, hash) +#### \_\_init_\_(recording_oracle_address, reputation_oracle_address, exchange_oracle_address, recording_oracle_fee, reputation_oracle_fee, exchange_oracle_fee, manifest, hash) Initializes a Escrow instance. @@ -541,7 +541,7 @@ Initializes a Escrow instance. * **reputation_oracle_address** (`str`) – Address of the Reputation Oracle * **recording_oracle_fee** (`Decimal`) – Fee percentage of the Recording Oracle * **reputation_oracle_fee** (`Decimal`) – Fee percentage of the Reputation Oracle - * **manifest_url** (`str`) – Manifest file url + * **manifest** (`str`) – Manifest data (can be a URL or JSON string) * **hash** (`str`) – Manifest file hash ### *class* human_protocol_sdk.escrow.escrow_client.EscrowWithdraw(tx_hash, token_address, amount_withdrawn) diff --git a/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md b/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md index 7638365935..53ce985248 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md @@ -22,11 +22,11 @@ print( ## Module -### *class* human_protocol_sdk.escrow.escrow_utils.EscrowData(chain_id, id, address, amount_paid, balance, count, factory_address, launcher, status, token, total_funded_amount, created_at, final_results_url=None, intermediate_results_url=None, manifest_hash=None, manifest_url=None, recording_oracle=None, reputation_oracle=None, exchange_oracle=None) +### *class* human_protocol_sdk.escrow.escrow_utils.EscrowData(chain_id, id, address, amount_paid, balance, count, factory_address, launcher, status, token, total_funded_amount, created_at, final_results_url=None, intermediate_results_url=None, manifest_hash=None, manifest=None, recording_oracle=None, reputation_oracle=None, exchange_oracle=None) Bases: `object` -#### \_\_init_\_(chain_id, id, address, amount_paid, balance, count, factory_address, launcher, status, token, total_funded_amount, created_at, final_results_url=None, intermediate_results_url=None, manifest_hash=None, manifest_url=None, recording_oracle=None, reputation_oracle=None, exchange_oracle=None) +#### \_\_init_\_(chain_id, id, address, amount_paid, balance, count, factory_address, launcher, status, token, total_funded_amount, created_at, final_results_url=None, intermediate_results_url=None, manifest_hash=None, manifest=None, recording_oracle=None, reputation_oracle=None, exchange_oracle=None) Initializes an EscrowData instance. @@ -46,7 +46,7 @@ Initializes an EscrowData instance. * **final_results_url** (`Optional`[`str`]) – URL for final results. * **intermediate_results_url** (`Optional`[`str`]) – URL for intermediate results. * **manifest_hash** (`Optional`[`str`]) – Manifest hash. - * **manifest_url** (`Optional`[`str`]) – Manifest URL. + * **manifest** (`Optional`[`str`]) – Manifest data (JSON/URL). * **recording_oracle** (`Optional`[`str`]) – Recording Oracle address. * **reputation_oracle** (`Optional`[`str`]) – Reputation Oracle address. * **exchange_oracle** (`Optional`[`str`]) – Exchange Oracle address. diff --git a/docs/sdk/python/human_protocol_sdk.escrow.md b/docs/sdk/python/human_protocol_sdk.escrow.md index deed876bfc..2e5c4e2e8b 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.md @@ -25,8 +25,8 @@ obtain information from both the contracts and subgraph. * [`EscrowClient.get_factory_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_factory_address) * [`EscrowClient.get_intermediate_results_url()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_intermediate_results_url) * [`EscrowClient.get_job_launcher_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_job_launcher_address) + * [`EscrowClient.get_manifest()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_manifest) * [`EscrowClient.get_manifest_hash()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_manifest_hash) - * [`EscrowClient.get_manifest_url()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_manifest_url) * [`EscrowClient.get_recording_oracle_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_recording_oracle_address) * [`EscrowClient.get_reputation_oracle_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_reputation_oracle_address) * [`EscrowClient.get_results_url()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_results_url) diff --git a/docs/sdk/python/human_protocol_sdk.filter.md b/docs/sdk/python/human_protocol_sdk.filter.md index a4b2004a2d..a4fdc897cd 100644 --- a/docs/sdk/python/human_protocol_sdk.filter.md +++ b/docs/sdk/python/human_protocol_sdk.filter.md @@ -17,7 +17,7 @@ Initializes a EscrowFilter instance. * **recording_oracle** (`Optional`[`str`]) – Recording oracle address * **exchange_oracle** (`Optional`[`str`]) – Exchange oracle address * **job_requester_id** (`Optional`[`str`]) – Job requester id - * **status** (`Optional`[[`Status`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status)]) – Escrow status + * **status** (`Union`[[`Status`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status), `List`[[`Status`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status)], `None`]) – Escrow status * **date_from** (`Optional`[`datetime`]) – Created from date * **date_to** (`Optional`[`datetime`]) – Created to date * **first** (`int`) – Number of items per page diff --git a/docs/sdk/python/human_protocol_sdk.md b/docs/sdk/python/human_protocol_sdk.md index ef2b0b539e..7cb3f24577 100644 --- a/docs/sdk/python/human_protocol_sdk.md +++ b/docs/sdk/python/human_protocol_sdk.md @@ -125,6 +125,7 @@ * [human_protocol_sdk.constants module](human_protocol_sdk.constants.md) * [`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId) + * [`ChainId.AURORA_TESTNET`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.AURORA_TESTNET) * [`ChainId.BSC_MAINNET`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.BSC_MAINNET) * [`ChainId.BSC_TESTNET`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.BSC_TESTNET) * [`ChainId.LOCALHOST`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.LOCALHOST) @@ -202,5 +203,6 @@ * [`get_staking_interface()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.get_staking_interface) * [`handle_error()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.handle_error) * [`parse_transfer_transaction()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.parse_transfer_transaction) + * [`validate_json()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.validate_json) * [`validate_url()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.validate_url) * [`with_retry()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.with_retry) diff --git a/docs/sdk/python/human_protocol_sdk.utils.md b/docs/sdk/python/human_protocol_sdk.utils.md index f0e73515b6..45fa0a776e 100644 --- a/docs/sdk/python/human_protocol_sdk.utils.md +++ b/docs/sdk/python/human_protocol_sdk.utils.md @@ -101,6 +101,14 @@ Parse a transfer transaction receipt. * **Returns:** A tuple indicating if HMT was transferred and the transaction balance +### human_protocol_sdk.utils.validate_json(data) + +Validates if the given string is a valid JSON. +:type data: `str` +:param data: String to validate +:rtype: `bool` +:return: True if the string is a valid JSON, False otherwise + ### human_protocol_sdk.utils.validate_url(url) Validates the given URL. diff --git a/docs/sdk/python/index.md b/docs/sdk/python/index.md index dcba33dab9..1939b9d54e 100644 --- a/docs/sdk/python/index.md +++ b/docs/sdk/python/index.md @@ -75,5 +75,6 @@ pip install human-protocol-sdk[agreement] * [`get_staking_interface()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.get_staking_interface) * [`handle_error()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.handle_error) * [`parse_transfer_transaction()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.parse_transfer_transaction) + * [`validate_json()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.validate_json) * [`validate_url()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.validate_url) * [`with_retry()`](human_protocol_sdk.utils.md#human_protocol_sdk.utils.with_retry) diff --git a/docs/sdk/typescript/base/classes/BaseEthersClient.md b/docs/sdk/typescript/base/classes/BaseEthersClient.md index f1ab048696..ed4b30dd39 100644 --- a/docs/sdk/typescript/base/classes/BaseEthersClient.md +++ b/docs/sdk/typescript/base/classes/BaseEthersClient.md @@ -6,7 +6,7 @@ # Class: `abstract` BaseEthersClient -Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) +Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) ## Introduction @@ -24,7 +24,7 @@ This class is used as a base class for other clients making on-chain calls. > **new BaseEthersClient**(`runner`, `networkData`): `BaseEthersClient` -Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) +Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) **BaseClient constructor** @@ -52,7 +52,7 @@ The network information required to connect to the contracts > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -60,4 +60,4 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9d > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) diff --git a/docs/sdk/typescript/encryption/classes/Encryption.md b/docs/sdk/typescript/encryption/classes/Encryption.md index ecf46779f5..61763a19ca 100644 --- a/docs/sdk/typescript/encryption/classes/Encryption.md +++ b/docs/sdk/typescript/encryption/classes/Encryption.md @@ -6,7 +6,7 @@ # Class: Encryption -Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) +Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) ## Introduction @@ -53,7 +53,7 @@ const encryption = await Encryption.build(privateKey, passphrase); > **new Encryption**(`privateKey`): `Encryption` -Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) +Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) Constructor for the Encryption class. @@ -75,7 +75,7 @@ The private key. > **decrypt**(`message`, `publicKey?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> -Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) +Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. @@ -129,7 +129,7 @@ const resultMessage = await encryption.decrypt('message'); > **sign**(`message`): `Promise`\<`string`\> -Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) +Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) This function signs a message using the private key used to initialize the client. @@ -165,7 +165,7 @@ const resultMessage = await encryption.sign('message'); > **signAndEncrypt**(`message`, `publicKeys`): `Promise`\<`string`\> -Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) +Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. @@ -232,7 +232,7 @@ const resultMessage = await encryption.signAndEncrypt('message', publicKeys); > `static` **build**(`privateKeyArmored`, `passphrase?`): `Promise`\<`Encryption`\> -Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) +Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. diff --git a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md index 7c56fe6d8f..72abc7550b 100644 --- a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md +++ b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md @@ -6,7 +6,7 @@ # Class: EncryptionUtils -Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) +Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) ## Introduction @@ -48,7 +48,7 @@ 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/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) +Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) This function encrypts a message using the specified public keys. @@ -111,7 +111,7 @@ const result = await EncryptionUtils.encrypt('message', publicKeys); > `static` **generateKeyPair**(`name`, `email`, `passphrase`): `Promise`\<[`IKeyPair`](../../interfaces/interfaces/IKeyPair.md)\> -Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) +Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) This function generates a key pair for encryption and decryption. @@ -158,7 +158,7 @@ const result = await EncryptionUtils.generateKeyPair(name, email, passphrase); > `static` **getSignedData**(`message`): `Promise`\<`string`\> -Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) +Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) This function gets signed data from a signed message. @@ -190,7 +190,7 @@ const signedData = await EncryptionUtils.getSignedData('message'); > `static` **isEncrypted**(`message`): `boolean` -Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) +Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) Verifies if a message appears to be encrypted with OpenPGP. @@ -238,7 +238,7 @@ if (isEncrypted) { > `static` **verify**(`message`, `publicKey`): `Promise`\<`boolean`\> -Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) +Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) This function verifies the signature of a signed message using the public key. diff --git a/docs/sdk/typescript/enums/enumerations/ChainId.md b/docs/sdk/typescript/enums/enumerations/ChainId.md index bb3a336000..4adc42b392 100644 --- a/docs/sdk/typescript/enums/enumerations/ChainId.md +++ b/docs/sdk/typescript/enums/enumerations/ChainId.md @@ -6,7 +6,7 @@ # Enumeration: ChainId -Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) +Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) ## Enumeration Members @@ -14,7 +14,15 @@ Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/9d > **ALL**: `-1` -Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) +Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) + +*** + +### AURORA\_TESTNET + +> **AURORA\_TESTNET**: `1313161555` + +Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) *** @@ -22,7 +30,7 @@ Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/9d > **BSC\_MAINNET**: `56` -Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) +Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) *** @@ -30,7 +38,7 @@ Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/9d > **BSC\_TESTNET**: `97` -Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) +Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) *** @@ -38,7 +46,7 @@ Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/9d > **LOCALHOST**: `1338` -Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) +Defined in: [enums.ts:10](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L10) *** @@ -46,7 +54,7 @@ Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/9d > **MAINNET**: `1` -Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) +Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) *** @@ -54,7 +62,7 @@ Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/9d > **POLYGON**: `137` -Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) +Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) *** @@ -62,7 +70,7 @@ Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/9d > **POLYGON\_AMOY**: `80002` -Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) +Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) *** @@ -70,4 +78,4 @@ Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/9d > **SEPOLIA**: `11155111` -Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) +Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) diff --git a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md index fe073231a7..e03dee05f7 100644 --- a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md +++ b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md @@ -6,7 +6,7 @@ # Enumeration: OperatorCategory -Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) +Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/9 > **MACHINE\_LEARNING**: `"machine_learning"` -Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) +Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) *** @@ -22,4 +22,4 @@ Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/9 > **MARKET\_MAKING**: `"market_making"` -Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) +Defined in: [enums.ts:20](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L20) diff --git a/docs/sdk/typescript/enums/enumerations/OrderDirection.md b/docs/sdk/typescript/enums/enumerations/OrderDirection.md index 44edbc1f67..c475fa2b31 100644 --- a/docs/sdk/typescript/enums/enumerations/OrderDirection.md +++ b/docs/sdk/typescript/enums/enumerations/OrderDirection.md @@ -6,7 +6,7 @@ # Enumeration: OrderDirection -Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) +Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/9 > **ASC**: `"asc"` -Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) +Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) *** @@ -22,4 +22,4 @@ Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/9 > **DESC**: `"desc"` -Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) +Defined in: [enums.ts:15](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L15) diff --git a/docs/sdk/typescript/escrow/classes/EscrowClient.md b/docs/sdk/typescript/escrow/classes/EscrowClient.md index 7963dd8ec6..ee1a65d55f 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowClient.md +++ b/docs/sdk/typescript/escrow/classes/EscrowClient.md @@ -6,7 +6,7 @@ # Class: EscrowClient -Defined in: [escrow.ts:142](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L142) +Defined in: [escrow.ts:143](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L143) ## Introduction @@ -86,7 +86,7 @@ const escrowClient = await EscrowClient.build(provider); > **new EscrowClient**(`runner`, `networkData`): `EscrowClient` -Defined in: [escrow.ts:151](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L151) +Defined in: [escrow.ts:152](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L152) **EscrowClient constructor** @@ -118,7 +118,7 @@ The network information required to connect to the Escrow contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from @@ -130,7 +130,7 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9d > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from @@ -142,7 +142,7 @@ Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/9d > **addTrustedHandlers**(`escrowAddress`, `trustedHandlers`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:779](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L779) +Defined in: [escrow.ts:777](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L777) This function adds an array of addresses to the trusted handlers list. @@ -197,7 +197,7 @@ await escrowClient.addTrustedHandlers('0x62dD51230A30401C455c8398d06F85e4EaB6309 > **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:612](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L612) +Defined in: [escrow.ts:610](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L610) This function pays out the amounts specified to the workers and sets the URL of the final results file. @@ -287,7 +287,7 @@ await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', reci > **cancel**(`escrowAddress`, `txOptions?`): `Promise`\<[`EscrowCancel`](../../types/type-aliases/EscrowCancel.md)\> -Defined in: [escrow.ts:693](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L693) +Defined in: [escrow.ts:691](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L691) This function cancels the specified escrow and sends the balance to the canceler. @@ -335,7 +335,7 @@ await escrowClient.cancel('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); > **complete**(`escrowAddress`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:551](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L551) +Defined in: [escrow.ts:549](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L549) This function sets the status of an escrow to completed. @@ -383,7 +383,7 @@ await escrowClient.complete('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); > **createBulkPayoutTransaction**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions?`): `Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> -Defined in: [escrow.ts:948](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L948) +Defined in: [escrow.ts:946](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L946) Creates a prepared transaction for bulk payout without immediately sending it. @@ -477,7 +477,7 @@ console.log('Tx hash:', ethers.keccak256(signedTransaction)); > **createEscrow**(`tokenAddress`, `trustedHandlers`, `jobRequesterId`, `txOptions?`): `Promise`\<`string`\> -Defined in: [escrow.ts:231](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L231) +Defined in: [escrow.ts:232](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L232) This function creates an escrow contract that uses the token passed to pay oracle fees and reward workers. @@ -540,7 +540,7 @@ const escrowAddress = await escrowClient.createEscrow(tokenAddress, trustedHandl > **fund**(`escrowAddress`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:422](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L422) +Defined in: [escrow.ts:420](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L420) This function adds funds of the chosen token to the escrow. @@ -593,7 +593,7 @@ await escrowClient.fund('0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount); > **getBalance**(`escrowAddress`): `Promise`\<`bigint`\> -Defined in: [escrow.ts:1093](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1093) +Defined in: [escrow.ts:1091](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1091) This function returns the balance for a specified escrow address. @@ -631,7 +631,7 @@ const balance = await escrowClient.getBalance('0x62dD51230A30401C455c8398d06F85e > **getExchangeOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1479](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1479) +Defined in: [escrow.ts:1477](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1477) This function returns the exchange oracle address for a given escrow. @@ -669,7 +669,7 @@ const oracleAddress = await escrowClient.getExchangeOracleAddress('0x62dD51230A3 > **getFactoryAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1517](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1517) +Defined in: [escrow.ts:1515](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1515) This function returns the escrow factory address for a given escrow. @@ -707,7 +707,7 @@ const factoryAddress = await escrowClient.getFactoryAddress('0x62dD51230A30401C4 > **getIntermediateResultsUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1251](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1251) +Defined in: [escrow.ts:1249](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1249) This function returns the intermediate results file URL. @@ -745,7 +745,7 @@ const intermediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x6 > **getJobLauncherAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1403](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1403) +Defined in: [escrow.ts:1401](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1401) This function returns the job launcher address for a given escrow. @@ -779,13 +779,13 @@ const jobLauncherAddress = await escrowClient.getJobLauncherAddress('0x62dD51230 *** -### getManifestHash() +### getManifest() -> **getManifestHash**(`escrowAddress`): `Promise`\<`string`\> +> **getManifest**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1137](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1137) +Defined in: [escrow.ts:1173](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1173) -This function returns the manifest file hash. +This function returns the manifest. Could be a URL or a JSON string. #### Parameters @@ -799,7 +799,7 @@ Address of the escrow. `Promise`\<`string`\> -Hash of the manifest file content. +Url of the manifest. **Code example** @@ -812,18 +812,18 @@ const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); const escrowClient = await EscrowClient.build(provider); -const manifestHash = await escrowClient.getManifestHash('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); +const manifest = await escrowClient.getManifest('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` *** -### getManifestUrl() +### getManifestHash() -> **getManifestUrl**(`escrowAddress`): `Promise`\<`string`\> +> **getManifestHash**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1175](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1175) +Defined in: [escrow.ts:1135](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1135) -This function returns the manifest file URL. +This function returns the manifest file hash. #### Parameters @@ -837,7 +837,7 @@ Address of the escrow. `Promise`\<`string`\> -Url of the manifest. +Hash of the manifest file content. **Code example** @@ -850,7 +850,7 @@ const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); const escrowClient = await EscrowClient.build(provider); -const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); +const manifestHash = await escrowClient.getManifestHash('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` *** @@ -859,7 +859,7 @@ const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c839 > **getRecordingOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1365](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1365) +Defined in: [escrow.ts:1363](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1363) This function returns the recording oracle address for a given escrow. @@ -897,7 +897,7 @@ const oracleAddress = await escrowClient.getRecordingOracleAddress('0x62dD51230A > **getReputationOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1441](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1441) +Defined in: [escrow.ts:1439](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1439) This function returns the reputation oracle address for a given escrow. @@ -935,7 +935,7 @@ const oracleAddress = await escrowClient.getReputationOracleAddress('0x62dD51230 > **getResultsUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1213](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1213) +Defined in: [escrow.ts:1211](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1211) This function returns the results file URL. @@ -973,7 +973,7 @@ const resultsUrl = await escrowClient.getResultsUrl('0x62dD51230A30401C455c8398d > **getStatus**(`escrowAddress`): `Promise`\<[`EscrowStatus`](../../types/enumerations/EscrowStatus.md)\> -Defined in: [escrow.ts:1327](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1327) +Defined in: [escrow.ts:1325](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1325) This function returns the current status of the escrow. @@ -1011,7 +1011,7 @@ const status = await escrowClient.getStatus('0x62dD51230A30401C455c8398d06F85e4E > **getTokenAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1289](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1289) +Defined in: [escrow.ts:1287](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1287) This function returns the token address used for funding the escrow. @@ -1049,7 +1049,7 @@ const tokenAddress = await escrowClient.getTokenAddress('0x62dD51230A30401C455c8 > **setup**(`escrowAddress`, `escrowConfig`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:312](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L312) +Defined in: [escrow.ts:313](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L313) This function sets up the parameters of the escrow. @@ -1102,7 +1102,7 @@ const escrowConfig = { recordingOracleFee: BigInt('10'), reputationOracleFee: BigInt('10'), exchangeOracleFee: BigInt('10'), - manifestUrl: 'http://localhost/manifest.json', + manifest: 'http://localhost/manifest.json', manifestHash: 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079', }; await escrowClient.setup(escrowAddress, escrowConfig); @@ -1114,7 +1114,7 @@ await escrowClient.setup(escrowAddress, escrowConfig); > **storeResults**(`escrowAddress`, `url`, `hash`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:487](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L487) +Defined in: [escrow.ts:485](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L485) This function stores the results URL and hash. @@ -1174,7 +1174,7 @@ await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'h > **withdraw**(`escrowAddress`, `tokenAddress`, `txOptions?`): `Promise`\<[`EscrowWithdraw`](../../types/type-aliases/EscrowWithdraw.md)\> -Defined in: [escrow.ts:845](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L845) +Defined in: [escrow.ts:843](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L843) This function withdraws additional tokens in the escrow to the canceler. @@ -1231,7 +1231,7 @@ await escrowClient.withdraw( > `static` **build**(`runner`): `Promise`\<`EscrowClient`\> -Defined in: [escrow.ts:169](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L169) +Defined in: [escrow.ts:170](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L170) Creates an instance of EscrowClient from a Runner. diff --git a/docs/sdk/typescript/escrow/classes/EscrowUtils.md b/docs/sdk/typescript/escrow/classes/EscrowUtils.md index e683ad1f73..926f04de2b 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowUtils.md +++ b/docs/sdk/typescript/escrow/classes/EscrowUtils.md @@ -6,7 +6,7 @@ # Class: EscrowUtils -Defined in: [escrow.ts:1566](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1566) +Defined in: [escrow.ts:1564](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1564) ## Introduction @@ -54,7 +54,7 @@ const escrowAddresses = new EscrowUtils.getEscrows({ > `static` **getEscrow**(`chainId`, `escrowAddress`): `Promise`\<[`IEscrow`](../../interfaces/interfaces/IEscrow.md)\> -Defined in: [escrow.ts:1779](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1779) +Defined in: [escrow.ts:1777](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1777) This function returns the escrow data for a given address. @@ -88,7 +88,7 @@ interface IEscrow { intermediateResultsUrl?: string; launcher: string; manifestHash?: string; - manifestUrl?: string; + manifest?: string; recordingOracle?: string; reputationOracle?: string; exchangeOracle?: string; @@ -133,7 +133,7 @@ const escrow = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x12345678901234 > `static` **getEscrows**(`filter`): `Promise`\<[`IEscrow`](../../interfaces/interfaces/IEscrow.md)[]\> -Defined in: [escrow.ts:1663](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1663) +Defined in: [escrow.ts:1661](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1661) This function returns an array of escrows based on the specified filter parameters. @@ -200,7 +200,7 @@ interface IEscrow { intermediateResultsUrl?: string; launcher: string; manifestHash?: string; - manifestUrl?: string; + manifest?: string; recordingOracle?: string; reputationOracle?: string; exchangeOracle?: string; @@ -245,7 +245,7 @@ const escrows = await EscrowUtils.getEscrows(filters); > `static` **getPayouts**(`filter`): `Promise`\<[`Payout`](../../types/type-aliases/Payout.md)[]\> -Defined in: [escrow.ts:1949](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1949) +Defined in: [escrow.ts:1947](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1947) This function returns the payouts for a given set of networks. @@ -289,7 +289,7 @@ console.log(payouts); > `static` **getStatusEvents**(`filter`): `Promise`\<[`StatusEvent`](../../graphql/types/type-aliases/StatusEvent.md)[]\> -Defined in: [escrow.ts:1858](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1858) +Defined in: [escrow.ts:1856](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1856) This function returns the status events for a given set of networks within an optional date range. diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md index e756468529..e53b762f65 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md @@ -8,7 +8,7 @@ > **DailyEscrowData** = `object` -Defined in: [graphql/types.ts:75](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L75) +Defined in: [graphql/types.ts:75](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L75) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:75](https://github.com/humanprotocol/human-protoco > **escrowsCancelled**: `number` -Defined in: [graphql/types.ts:81](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L81) +Defined in: [graphql/types.ts:81](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L81) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:81](https://github.com/humanprotocol/human-protoco > **escrowsPaid**: `number` -Defined in: [graphql/types.ts:80](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L80) +Defined in: [graphql/types.ts:80](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L80) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:80](https://github.com/humanprotocol/human-protoco > **escrowsPending**: `number` -Defined in: [graphql/types.ts:78](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L78) +Defined in: [graphql/types.ts:78](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L78) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:78](https://github.com/humanprotocol/human-protoco > **escrowsSolved**: `number` -Defined in: [graphql/types.ts:79](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L79) +Defined in: [graphql/types.ts:79](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L79) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:79](https://github.com/humanprotocol/human-protoco > **escrowsTotal**: `number` -Defined in: [graphql/types.ts:77](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L77) +Defined in: [graphql/types.ts:77](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L77) *** @@ -56,4 +56,4 @@ Defined in: [graphql/types.ts:77](https://github.com/humanprotocol/human-protoco > **timestamp**: `Date` -Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) +Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md index 00b8281cee..e8f16475c6 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md @@ -8,7 +8,7 @@ > **DailyHMTData** = `object` -Defined in: [graphql/types.ts:119](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L119) +Defined in: [graphql/types.ts:119](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L119) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:119](https://github.com/humanprotocol/human-protoc > **dailyUniqueReceivers**: `number` -Defined in: [graphql/types.ts:124](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L124) +Defined in: [graphql/types.ts:124](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L124) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:124](https://github.com/humanprotocol/human-protoc > **dailyUniqueSenders**: `number` -Defined in: [graphql/types.ts:123](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L123) +Defined in: [graphql/types.ts:123](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L123) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:123](https://github.com/humanprotocol/human-protoc > **timestamp**: `Date` -Defined in: [graphql/types.ts:120](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L120) +Defined in: [graphql/types.ts:120](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L120) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:120](https://github.com/humanprotocol/human-protoc > **totalTransactionAmount**: `bigint` -Defined in: [graphql/types.ts:121](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L121) +Defined in: [graphql/types.ts:121](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L121) *** @@ -48,4 +48,4 @@ Defined in: [graphql/types.ts:121](https://github.com/humanprotocol/human-protoc > **totalTransactionCount**: `number` -Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) +Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md index 579d949a7c..853d8287ab 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md @@ -8,7 +8,7 @@ > **DailyPaymentData** = `object` -Defined in: [graphql/types.ts:98](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L98) +Defined in: [graphql/types.ts:98](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L98) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:98](https://github.com/humanprotocol/human-protoco > **averageAmountPerWorker**: `bigint` -Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) +Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protoc > **timestamp**: `Date` -Defined in: [graphql/types.ts:99](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L99) +Defined in: [graphql/types.ts:99](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L99) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:99](https://github.com/humanprotocol/human-protoco > **totalAmountPaid**: `bigint` -Defined in: [graphql/types.ts:100](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L100) +Defined in: [graphql/types.ts:100](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L100) *** @@ -40,4 +40,4 @@ Defined in: [graphql/types.ts:100](https://github.com/humanprotocol/human-protoc > **totalCount**: `number` -Defined in: [graphql/types.ts:101](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L101) +Defined in: [graphql/types.ts:101](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L101) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md index 64c00976cd..8cee35ad4a 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md @@ -8,7 +8,7 @@ > **DailyTaskData** = `object` -Defined in: [graphql/types.ts:140](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L140) +Defined in: [graphql/types.ts:140](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L140) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:140](https://github.com/humanprotocol/human-protoc > **tasksSolved**: `number` -Defined in: [graphql/types.ts:143](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L143) +Defined in: [graphql/types.ts:143](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L143) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:143](https://github.com/humanprotocol/human-protoc > **tasksTotal**: `number` -Defined in: [graphql/types.ts:142](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L142) +Defined in: [graphql/types.ts:142](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L142) *** @@ -32,4 +32,4 @@ Defined in: [graphql/types.ts:142](https://github.com/humanprotocol/human-protoc > **timestamp**: `Date` -Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) +Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md index 5afd7db4fb..3d5408621e 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md @@ -8,7 +8,7 @@ > **DailyWorkerData** = `object` -Defined in: [graphql/types.ts:89](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L89) +Defined in: [graphql/types.ts:89](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L89) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:89](https://github.com/humanprotocol/human-protoco > **activeWorkers**: `number` -Defined in: [graphql/types.ts:91](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L91) +Defined in: [graphql/types.ts:91](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L91) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:91](https://github.com/humanprotocol/human-protoco > **timestamp**: `Date` -Defined in: [graphql/types.ts:90](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L90) +Defined in: [graphql/types.ts:90](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L90) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md index f2db4f6a50..9db27b21d4 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md @@ -8,7 +8,7 @@ > **EscrowData** = `object` -Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) +Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol > **address**: `string` -Defined in: [graphql/types.ts:5](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L5) +Defined in: [graphql/types.ts:5](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L5) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:5](https://github.com/humanprotocol/human-protocol > **amountPaid**: `string` -Defined in: [graphql/types.ts:6](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L6) +Defined in: [graphql/types.ts:6](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L6) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:6](https://github.com/humanprotocol/human-protocol > **balance**: `string` -Defined in: [graphql/types.ts:7](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L7) +Defined in: [graphql/types.ts:7](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L7) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:7](https://github.com/humanprotocol/human-protocol > **chainId**: `number` -Defined in: [graphql/types.ts:22](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L22) +Defined in: [graphql/types.ts:22](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L22) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:22](https://github.com/humanprotocol/human-protoco > **count**: `string` -Defined in: [graphql/types.ts:8](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L8) +Defined in: [graphql/types.ts:8](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L8) *** @@ -56,7 +56,7 @@ Defined in: [graphql/types.ts:8](https://github.com/humanprotocol/human-protocol > **createdAt**: `string` -Defined in: [graphql/types.ts:21](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L21) +Defined in: [graphql/types.ts:21](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L21) *** @@ -64,7 +64,7 @@ Defined in: [graphql/types.ts:21](https://github.com/humanprotocol/human-protoco > `optional` **exchangeOracle**: `string` -Defined in: [graphql/types.ts:17](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L17) +Defined in: [graphql/types.ts:17](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L17) *** @@ -72,7 +72,7 @@ Defined in: [graphql/types.ts:17](https://github.com/humanprotocol/human-protoco > **factoryAddress**: `string` -Defined in: [graphql/types.ts:9](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L9) +Defined in: [graphql/types.ts:9](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L9) *** @@ -80,7 +80,7 @@ Defined in: [graphql/types.ts:9](https://github.com/humanprotocol/human-protocol > `optional` **finalResultsUrl**: `string` -Defined in: [graphql/types.ts:10](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L10) +Defined in: [graphql/types.ts:10](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L10) *** @@ -88,7 +88,7 @@ Defined in: [graphql/types.ts:10](https://github.com/humanprotocol/human-protoco > **id**: `string` -Defined in: [graphql/types.ts:4](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L4) +Defined in: [graphql/types.ts:4](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L4) *** @@ -96,7 +96,7 @@ Defined in: [graphql/types.ts:4](https://github.com/humanprotocol/human-protocol > `optional` **intermediateResultsUrl**: `string` -Defined in: [graphql/types.ts:11](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L11) +Defined in: [graphql/types.ts:11](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L11) *** @@ -104,7 +104,7 @@ Defined in: [graphql/types.ts:11](https://github.com/humanprotocol/human-protoco > **launcher**: `string` -Defined in: [graphql/types.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L12) +Defined in: [graphql/types.ts:12](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L12) *** @@ -112,7 +112,7 @@ Defined in: [graphql/types.ts:12](https://github.com/humanprotocol/human-protoco > `optional` **manifestHash**: `string` -Defined in: [graphql/types.ts:13](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L13) +Defined in: [graphql/types.ts:13](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L13) *** @@ -120,7 +120,7 @@ Defined in: [graphql/types.ts:13](https://github.com/humanprotocol/human-protoco > `optional` **manifestUrl**: `string` -Defined in: [graphql/types.ts:14](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L14) +Defined in: [graphql/types.ts:14](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L14) *** @@ -128,7 +128,7 @@ Defined in: [graphql/types.ts:14](https://github.com/humanprotocol/human-protoco > `optional` **recordingOracle**: `string` -Defined in: [graphql/types.ts:15](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L15) +Defined in: [graphql/types.ts:15](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L15) *** @@ -136,7 +136,7 @@ Defined in: [graphql/types.ts:15](https://github.com/humanprotocol/human-protoco > `optional` **reputationOracle**: `string` -Defined in: [graphql/types.ts:16](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L16) +Defined in: [graphql/types.ts:16](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L16) *** @@ -144,7 +144,7 @@ Defined in: [graphql/types.ts:16](https://github.com/humanprotocol/human-protoco > **status**: `string` -Defined in: [graphql/types.ts:18](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L18) +Defined in: [graphql/types.ts:18](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L18) *** @@ -152,7 +152,7 @@ Defined in: [graphql/types.ts:18](https://github.com/humanprotocol/human-protoco > **token**: `string` -Defined in: [graphql/types.ts:19](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L19) +Defined in: [graphql/types.ts:19](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L19) *** @@ -160,4 +160,4 @@ Defined in: [graphql/types.ts:19](https://github.com/humanprotocol/human-protoco > **totalFundedAmount**: `string` -Defined in: [graphql/types.ts:20](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L20) +Defined in: [graphql/types.ts:20](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L20) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md index ec1bd885db..ca5424182b 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md @@ -8,7 +8,7 @@ > **EscrowStatistics** = `object` -Defined in: [graphql/types.ts:84](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L84) +Defined in: [graphql/types.ts:84](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L84) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:84](https://github.com/humanprotocol/human-protoco > **dailyEscrowsData**: [`DailyEscrowData`](DailyEscrowData.md)[] -Defined in: [graphql/types.ts:86](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L86) +Defined in: [graphql/types.ts:86](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L86) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:86](https://github.com/humanprotocol/human-protoco > **totalEscrows**: `number` -Defined in: [graphql/types.ts:85](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L85) +Defined in: [graphql/types.ts:85](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L85) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md index eaea901611..51aa8ec823 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md @@ -8,7 +8,7 @@ > **EscrowStatisticsData** = `object` -Defined in: [graphql/types.ts:34](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L34) +Defined in: [graphql/types.ts:34](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L34) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:34](https://github.com/humanprotocol/human-protoco > **bulkPayoutEventCount**: `string` -Defined in: [graphql/types.ts:37](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L37) +Defined in: [graphql/types.ts:37](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L37) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:37](https://github.com/humanprotocol/human-protoco > **cancelledStatusEventCount**: `string` -Defined in: [graphql/types.ts:39](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L39) +Defined in: [graphql/types.ts:39](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L39) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:39](https://github.com/humanprotocol/human-protoco > **completedStatusEventCount**: `string` -Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) +Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protoco > **fundEventCount**: `string` -Defined in: [graphql/types.ts:35](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L35) +Defined in: [graphql/types.ts:35](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L35) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:35](https://github.com/humanprotocol/human-protoco > **paidStatusEventCount**: `string` -Defined in: [graphql/types.ts:41](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L41) +Defined in: [graphql/types.ts:41](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L41) *** @@ -56,7 +56,7 @@ Defined in: [graphql/types.ts:41](https://github.com/humanprotocol/human-protoco > **partialStatusEventCount**: `string` -Defined in: [graphql/types.ts:40](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L40) +Defined in: [graphql/types.ts:40](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L40) *** @@ -64,7 +64,7 @@ Defined in: [graphql/types.ts:40](https://github.com/humanprotocol/human-protoco > **pendingStatusEventCount**: `string` -Defined in: [graphql/types.ts:38](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L38) +Defined in: [graphql/types.ts:38](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L38) *** @@ -72,7 +72,7 @@ Defined in: [graphql/types.ts:38](https://github.com/humanprotocol/human-protoco > **storeResultsEventCount**: `string` -Defined in: [graphql/types.ts:36](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L36) +Defined in: [graphql/types.ts:36](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L36) *** @@ -80,7 +80,7 @@ Defined in: [graphql/types.ts:36](https://github.com/humanprotocol/human-protoco > **totalEscrowCount**: `string` -Defined in: [graphql/types.ts:44](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L44) +Defined in: [graphql/types.ts:44](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L44) *** @@ -88,4 +88,4 @@ Defined in: [graphql/types.ts:44](https://github.com/humanprotocol/human-protoco > **totalEventCount**: `string` -Defined in: [graphql/types.ts:43](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L43) +Defined in: [graphql/types.ts:43](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L43) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md index 75206a67ad..489a91d1a8 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md @@ -8,7 +8,7 @@ > **EventDayData** = `object` -Defined in: [graphql/types.ts:47](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L47) +Defined in: [graphql/types.ts:47](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L47) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:47](https://github.com/humanprotocol/human-protoco > **dailyBulkPayoutEventCount**: `string` -Defined in: [graphql/types.ts:51](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L51) +Defined in: [graphql/types.ts:51](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L51) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:51](https://github.com/humanprotocol/human-protoco > **dailyCancelledStatusEventCount**: `string` -Defined in: [graphql/types.ts:53](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L53) +Defined in: [graphql/types.ts:53](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L53) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:53](https://github.com/humanprotocol/human-protoco > **dailyCompletedStatusEventCount**: `string` -Defined in: [graphql/types.ts:56](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L56) +Defined in: [graphql/types.ts:56](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L56) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:56](https://github.com/humanprotocol/human-protoco > **dailyEscrowCount**: `string` -Defined in: [graphql/types.ts:58](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L58) +Defined in: [graphql/types.ts:58](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L58) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:58](https://github.com/humanprotocol/human-protoco > **dailyFundEventCount**: `string` -Defined in: [graphql/types.ts:49](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L49) +Defined in: [graphql/types.ts:49](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L49) *** @@ -56,7 +56,7 @@ Defined in: [graphql/types.ts:49](https://github.com/humanprotocol/human-protoco > **dailyHMTPayoutAmount**: `string` -Defined in: [graphql/types.ts:61](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L61) +Defined in: [graphql/types.ts:61](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L61) *** @@ -64,7 +64,7 @@ Defined in: [graphql/types.ts:61](https://github.com/humanprotocol/human-protoco > **dailyHMTTransferAmount**: `string` -Defined in: [graphql/types.ts:63](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L63) +Defined in: [graphql/types.ts:63](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L63) *** @@ -72,7 +72,7 @@ Defined in: [graphql/types.ts:63](https://github.com/humanprotocol/human-protoco > **dailyHMTTransferCount**: `string` -Defined in: [graphql/types.ts:62](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L62) +Defined in: [graphql/types.ts:62](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L62) *** @@ -80,7 +80,7 @@ Defined in: [graphql/types.ts:62](https://github.com/humanprotocol/human-protoco > **dailyPaidStatusEventCount**: `string` -Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) +Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) *** @@ -88,7 +88,7 @@ Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protoco > **dailyPartialStatusEventCount**: `string` -Defined in: [graphql/types.ts:54](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L54) +Defined in: [graphql/types.ts:54](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L54) *** @@ -96,7 +96,7 @@ Defined in: [graphql/types.ts:54](https://github.com/humanprotocol/human-protoco > **dailyPayoutCount**: `string` -Defined in: [graphql/types.ts:60](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L60) +Defined in: [graphql/types.ts:60](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L60) *** @@ -104,7 +104,7 @@ Defined in: [graphql/types.ts:60](https://github.com/humanprotocol/human-protoco > **dailyPendingStatusEventCount**: `string` -Defined in: [graphql/types.ts:52](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L52) +Defined in: [graphql/types.ts:52](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L52) *** @@ -112,7 +112,7 @@ Defined in: [graphql/types.ts:52](https://github.com/humanprotocol/human-protoco > **dailyStoreResultsEventCount**: `string` -Defined in: [graphql/types.ts:50](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L50) +Defined in: [graphql/types.ts:50](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L50) *** @@ -120,7 +120,7 @@ Defined in: [graphql/types.ts:50](https://github.com/humanprotocol/human-protoco > **dailyTotalEventCount**: `string` -Defined in: [graphql/types.ts:57](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L57) +Defined in: [graphql/types.ts:57](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L57) *** @@ -128,7 +128,7 @@ Defined in: [graphql/types.ts:57](https://github.com/humanprotocol/human-protoco > **dailyUniqueReceivers**: `string` -Defined in: [graphql/types.ts:65](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L65) +Defined in: [graphql/types.ts:65](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L65) *** @@ -136,7 +136,7 @@ Defined in: [graphql/types.ts:65](https://github.com/humanprotocol/human-protoco > **dailyUniqueSenders**: `string` -Defined in: [graphql/types.ts:64](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L64) +Defined in: [graphql/types.ts:64](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L64) *** @@ -144,7 +144,7 @@ Defined in: [graphql/types.ts:64](https://github.com/humanprotocol/human-protoco > **dailyWorkerCount**: `string` -Defined in: [graphql/types.ts:59](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L59) +Defined in: [graphql/types.ts:59](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L59) *** @@ -152,4 +152,4 @@ Defined in: [graphql/types.ts:59](https://github.com/humanprotocol/human-protoco > **timestamp**: `string` -Defined in: [graphql/types.ts:48](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L48) +Defined in: [graphql/types.ts:48](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L48) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md index c071ee89e1..836259a0da 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md @@ -8,7 +8,7 @@ > **HMTHolder** = `object` -Defined in: [graphql/types.ts:114](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L114) +Defined in: [graphql/types.ts:114](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L114) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:114](https://github.com/humanprotocol/human-protoc > **address**: `string` -Defined in: [graphql/types.ts:115](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L115) +Defined in: [graphql/types.ts:115](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L115) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:115](https://github.com/humanprotocol/human-protoc > **balance**: `bigint` -Defined in: [graphql/types.ts:116](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L116) +Defined in: [graphql/types.ts:116](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L116) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md index ee55c1590c..059c8fb252 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md @@ -8,7 +8,7 @@ > **HMTHolderData** = `object` -Defined in: [graphql/types.ts:109](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L109) +Defined in: [graphql/types.ts:109](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L109) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:109](https://github.com/humanprotocol/human-protoc > **address**: `string` -Defined in: [graphql/types.ts:110](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L110) +Defined in: [graphql/types.ts:110](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L110) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:110](https://github.com/humanprotocol/human-protoc > **balance**: `string` -Defined in: [graphql/types.ts:111](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L111) +Defined in: [graphql/types.ts:111](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L111) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md index f55590cbf4..53cde95bbf 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md @@ -8,7 +8,7 @@ > **HMTStatistics** = `object` -Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) +Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protoc > **totalHolders**: `number` -Defined in: [graphql/types.ts:130](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L130) +Defined in: [graphql/types.ts:130](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L130) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:130](https://github.com/humanprotocol/human-protoc > **totalTransferAmount**: `bigint` -Defined in: [graphql/types.ts:128](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L128) +Defined in: [graphql/types.ts:128](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L128) *** @@ -32,4 +32,4 @@ Defined in: [graphql/types.ts:128](https://github.com/humanprotocol/human-protoc > **totalTransferCount**: `number` -Defined in: [graphql/types.ts:129](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L129) +Defined in: [graphql/types.ts:129](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L129) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md index 2a17ef82dd..d885859cd1 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md @@ -8,7 +8,7 @@ > **HMTStatisticsData** = `object` -Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) +Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protoco > **holders**: `string` -Defined in: [graphql/types.ts:31](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L31) +Defined in: [graphql/types.ts:31](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L31) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:31](https://github.com/humanprotocol/human-protoco > **totalApprovalEventCount**: `string` -Defined in: [graphql/types.ts:28](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L28) +Defined in: [graphql/types.ts:28](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L28) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:28](https://github.com/humanprotocol/human-protoco > **totalBulkApprovalEventCount**: `string` -Defined in: [graphql/types.ts:29](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L29) +Defined in: [graphql/types.ts:29](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L29) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:29](https://github.com/humanprotocol/human-protoco > **totalBulkTransferEventCount**: `string` -Defined in: [graphql/types.ts:27](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L27) +Defined in: [graphql/types.ts:27](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L27) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:27](https://github.com/humanprotocol/human-protoco > **totalTransferEventCount**: `string` -Defined in: [graphql/types.ts:26](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L26) +Defined in: [graphql/types.ts:26](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L26) *** @@ -56,4 +56,4 @@ Defined in: [graphql/types.ts:26](https://github.com/humanprotocol/human-protoco > **totalValueTransfered**: `string` -Defined in: [graphql/types.ts:30](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L30) +Defined in: [graphql/types.ts:30](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L30) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md index 37ddf93d0d..1ac7650399 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md @@ -8,4 +8,4 @@ > **IMData** = `Record`\<`string`, [`IMDataEntity`](IMDataEntity.md)\> -Defined in: [graphql/types.ts:138](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L138) +Defined in: [graphql/types.ts:138](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L138) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md index 96725b9155..c4bb7e5f67 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md @@ -8,7 +8,7 @@ > **IMDataEntity** = `object` -Defined in: [graphql/types.ts:133](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L133) +Defined in: [graphql/types.ts:133](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L133) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:133](https://github.com/humanprotocol/human-protoc > **served**: `number` -Defined in: [graphql/types.ts:134](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L134) +Defined in: [graphql/types.ts:134](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L134) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:134](https://github.com/humanprotocol/human-protoc > **solved**: `number` -Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) +Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md index 8780ce7efd..c7d1401b32 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md @@ -8,7 +8,7 @@ > **KVStoreData** = `object` -Defined in: [graphql/types.ts:157](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L157) +Defined in: [graphql/types.ts:157](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L157) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:157](https://github.com/humanprotocol/human-protoc > **address**: `string` -Defined in: [graphql/types.ts:159](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L159) +Defined in: [graphql/types.ts:159](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L159) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:159](https://github.com/humanprotocol/human-protoc > **block**: `number` -Defined in: [graphql/types.ts:163](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L163) +Defined in: [graphql/types.ts:163](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L163) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:163](https://github.com/humanprotocol/human-protoc > **id**: `string` -Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) +Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protoc > **key**: `string` -Defined in: [graphql/types.ts:160](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L160) +Defined in: [graphql/types.ts:160](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L160) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:160](https://github.com/humanprotocol/human-protoc > **timestamp**: `Date` -Defined in: [graphql/types.ts:162](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L162) +Defined in: [graphql/types.ts:162](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L162) *** @@ -56,4 +56,4 @@ Defined in: [graphql/types.ts:162](https://github.com/humanprotocol/human-protoc > **value**: `string` -Defined in: [graphql/types.ts:161](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L161) +Defined in: [graphql/types.ts:161](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L161) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md index 64b2e63133..37626aafcd 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md @@ -8,7 +8,7 @@ > **PaymentStatistics** = `object` -Defined in: [graphql/types.ts:105](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L105) +Defined in: [graphql/types.ts:105](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L105) ## Properties @@ -16,4 +16,4 @@ Defined in: [graphql/types.ts:105](https://github.com/humanprotocol/human-protoc > **dailyPaymentsData**: [`DailyPaymentData`](DailyPaymentData.md)[] -Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) +Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md index abb41fb55f..f5f5d1b3ed 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md @@ -8,7 +8,7 @@ > **RewardAddedEventData** = `object` -Defined in: [graphql/types.ts:68](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L68) +Defined in: [graphql/types.ts:68](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L68) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:68](https://github.com/humanprotocol/human-protoco > **amount**: `string` -Defined in: [graphql/types.ts:72](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L72) +Defined in: [graphql/types.ts:72](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L72) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:72](https://github.com/humanprotocol/human-protoco > **escrowAddress**: `string` -Defined in: [graphql/types.ts:69](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L69) +Defined in: [graphql/types.ts:69](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L69) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:69](https://github.com/humanprotocol/human-protoco > **slasher**: `string` -Defined in: [graphql/types.ts:71](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L71) +Defined in: [graphql/types.ts:71](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L71) *** @@ -40,4 +40,4 @@ Defined in: [graphql/types.ts:71](https://github.com/humanprotocol/human-protoco > **staker**: `string` -Defined in: [graphql/types.ts:70](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L70) +Defined in: [graphql/types.ts:70](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L70) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md index 52ab27fbf9..b558d3b3d8 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md @@ -8,7 +8,7 @@ > **StatusEvent** = `object` -Defined in: [graphql/types.ts:150](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L150) +Defined in: [graphql/types.ts:150](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L150) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:150](https://github.com/humanprotocol/human-protoc > **chainId**: [`ChainId`](../../../enums/enumerations/ChainId.md) -Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) +Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protoc > **escrowAddress**: `string` -Defined in: [graphql/types.ts:152](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L152) +Defined in: [graphql/types.ts:152](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L152) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:152](https://github.com/humanprotocol/human-protoc > **status**: `string` -Defined in: [graphql/types.ts:153](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L153) +Defined in: [graphql/types.ts:153](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L153) *** @@ -40,4 +40,4 @@ Defined in: [graphql/types.ts:153](https://github.com/humanprotocol/human-protoc > **timestamp**: `number` -Defined in: [graphql/types.ts:151](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L151) +Defined in: [graphql/types.ts:151](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L151) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md index 74d99dda6a..3cb7a96f97 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md @@ -8,7 +8,7 @@ > **TaskStatistics** = `object` -Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) +Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) ## Properties @@ -16,4 +16,4 @@ Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protoc > **dailyTasksData**: [`DailyTaskData`](DailyTaskData.md)[] -Defined in: [graphql/types.ts:147](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L147) +Defined in: [graphql/types.ts:147](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L147) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md index bcf440fac5..ca99258a2b 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md @@ -8,7 +8,7 @@ > **WorkerStatistics** = `object` -Defined in: [graphql/types.ts:94](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L94) +Defined in: [graphql/types.ts:94](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L94) ## Properties @@ -16,4 +16,4 @@ Defined in: [graphql/types.ts:94](https://github.com/humanprotocol/human-protoco > **dailyWorkersData**: [`DailyWorkerData`](DailyWorkerData.md)[] -Defined in: [graphql/types.ts:95](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L95) +Defined in: [graphql/types.ts:95](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L95) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrow.md b/docs/sdk/typescript/interfaces/interfaces/IEscrow.md index 6406bbc853..298af5c794 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrow.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrow.md @@ -6,7 +6,7 @@ # Interface: IEscrow -Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) +Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) +Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/b > **amountPaid**: `string` -Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) +Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/b > **balance**: `string` -Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) +Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/b > **chainId**: `number` -Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) +Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/b > **count**: `string` -Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) +Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/b > **createdAt**: `string` -Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) +Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/b > `optional` **exchangeOracle**: `string` -Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) +Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/b > **factoryAddress**: `string` -Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) +Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/b > `optional` **finalResultsUrl**: `string` -Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) +Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) +Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) *** @@ -94,7 +94,7 @@ Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/b > `optional` **intermediateResultsUrl**: `string` -Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) +Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) *** @@ -102,23 +102,23 @@ Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/b > **launcher**: `string` -Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) +Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) *** -### manifestHash? +### manifest? -> `optional` **manifestHash**: `string` +> `optional` **manifest**: `string` -Defined in: [interfaces.ts:77](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L77) +Defined in: [interfaces.ts:78](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L78) *** -### manifestUrl? +### manifestHash? -> `optional` **manifestUrl**: `string` +> `optional` **manifestHash**: `string` -Defined in: [interfaces.ts:78](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L78) +Defined in: [interfaces.ts:77](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L77) *** @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:78](https://github.com/humanprotocol/human-protocol/b > `optional` **recordingOracle**: `string` -Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) +Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationOracle**: `string` -Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) +Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) *** @@ -142,7 +142,7 @@ Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/b > **status**: `string` -Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) +Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) *** @@ -150,7 +150,7 @@ Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/b > **token**: `string` -Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) +Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) *** @@ -158,4 +158,4 @@ Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/b > **totalFundedAmount**: `string` -Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) +Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md index d31f5f0eff..424378fc5d 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md @@ -6,7 +6,7 @@ # Interface: IEscrowConfig -Defined in: [interfaces.ts:101](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L101) +Defined in: [interfaces.ts:101](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L101) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:101](https://github.com/humanprotocol/human-protocol/ > **exchangeOracle**: `string` -Defined in: [interfaces.ts:104](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L104) +Defined in: [interfaces.ts:104](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L104) *** @@ -22,23 +22,23 @@ Defined in: [interfaces.ts:104](https://github.com/humanprotocol/human-protocol/ > **exchangeOracleFee**: `bigint` -Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) +Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) *** -### manifestHash +### manifest -> **manifestHash**: `string` +> **manifest**: `string` -Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) +Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) *** -### manifestUrl +### manifestHash -> **manifestUrl**: `string` +> **manifestHash**: `string` -Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) +Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/ > **recordingOracle**: `string` -Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) +Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/ > **recordingOracleFee**: `bigint` -Defined in: [interfaces.ts:105](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L105) +Defined in: [interfaces.ts:105](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L105) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:105](https://github.com/humanprotocol/human-protocol/ > **reputationOracle**: `string` -Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) +Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) *** @@ -70,4 +70,4 @@ Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/ > **reputationOracleFee**: `bigint` -Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) +Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md index 0bef7e56bf..ce24c60348 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md @@ -6,7 +6,7 @@ # Interface: IEscrowsFilter -Defined in: [interfaces.ts:89](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L89) +Defined in: [interfaces.ts:89](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L89) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:89](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) +Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/b > `optional` **exchangeOracle**: `string` -Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) +Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:96](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L96) +Defined in: [interfaces.ts:96](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L96) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:96](https://github.com/humanprotocol/human-protocol/b > `optional` **jobRequesterId**: `string` -Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) +Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/b > `optional` **launcher**: `string` -Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) +Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **recordingOracle**: `string` -Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) +Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) *** @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationOracle**: `string` -Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) +Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) *** @@ -98,7 +98,7 @@ Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/b > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) #### Inherited from @@ -108,9 +108,9 @@ Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/ ### status? -> `optional` **status**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md) +> `optional` **status**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md) \| [`EscrowStatus`](../../types/enumerations/EscrowStatus.md)[] -Defined in: [interfaces.ts:95](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L95) +Defined in: [interfaces.ts:95](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L95) *** @@ -118,4 +118,4 @@ Defined in: [interfaces.ts:95](https://github.com/humanprotocol/human-protocol/b > `optional` **to**: `Date` -Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) +Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) diff --git a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md index 9c4097219f..8ddfa82c62 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md +++ b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md @@ -6,7 +6,7 @@ # Interface: IHMTHoldersParams -Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) +Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/ > `optional` **address**: `string` -Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) +Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) #### Inherited from @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md index 65d7fb2001..2cc3b85865 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md @@ -6,7 +6,7 @@ # Interface: IKVStore -Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) +Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/ > **key**: `string` -Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) +Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) *** @@ -22,4 +22,4 @@ Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) +Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) diff --git a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md index fe1c0e7104..2498c3f3f2 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md @@ -6,7 +6,7 @@ # Interface: IKeyPair -Defined in: [interfaces.ts:112](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L112) +Defined in: [interfaces.ts:112](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L112) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:112](https://github.com/humanprotocol/human-protocol/ > **passphrase**: `string` -Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) +Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/ > **privateKey**: `string` -Defined in: [interfaces.ts:113](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L113) +Defined in: [interfaces.ts:113](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L113) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:113](https://github.com/humanprotocol/human-protocol/ > **publicKey**: `string` -Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) +Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/ > `optional` **revocationCertificate**: `string` -Defined in: [interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) +Defined in: [interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperator.md b/docs/sdk/typescript/interfaces/interfaces/IOperator.md index 66175a367e..d8c9e4149f 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperator.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperator.md @@ -6,7 +6,7 @@ # Interface: IOperator -Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) +Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/bl > **address**: `string` -Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/b > **amountJobsProcessed**: `bigint` -Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/b > **amountLocked**: `bigint` -Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/b > **amountSlashed**: `bigint` -Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/b > **amountStaked**: `bigint` -Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/b > **amountWithdrawn**: `bigint` -Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/b > `optional` **category**: `string` -Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) +Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/b > `optional` **fee**: `bigint` -Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) *** @@ -94,7 +94,7 @@ Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/b > `optional` **jobTypes**: `string`[] -Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) +Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) *** @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/b > **lockedUntilTimestamp**: `bigint` -Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) *** @@ -110,7 +110,7 @@ Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/b > `optional` **name**: `string` -Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) *** @@ -118,7 +118,7 @@ Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/b > `optional` **publicKey**: `string` -Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) *** @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationInstructions**: `string` -Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationNeeded**: `boolean` -Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) *** @@ -142,7 +142,7 @@ Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationNetworks**: `string`[] -Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) +Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) *** @@ -150,7 +150,7 @@ Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/b > **reward**: `bigint` -Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) *** @@ -158,7 +158,7 @@ Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/b > `optional` **role**: `string` -Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) *** @@ -166,7 +166,7 @@ Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/b > `optional` **url**: `string` -Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) *** @@ -174,7 +174,7 @@ Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/b > `optional` **webhookUrl**: `string` -Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) *** @@ -182,4 +182,4 @@ Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/b > `optional` **website**: `string` -Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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 a3dc14f782..aa318b8995 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md @@ -6,7 +6,7 @@ # Interface: IOperatorSubgraph -Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) +Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/b > **amountJobsProcessed**: `bigint` -Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) #### Inherited from @@ -42,7 +42,7 @@ Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/b > **amountLocked**: `bigint` -Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) #### Inherited from @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/b > **amountSlashed**: `bigint` -Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/b > **amountStaked**: `bigint` -Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/b > **amountWithdrawn**: `bigint` -Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) #### Inherited from @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/b > `optional` **category**: `string` -Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) #### Inherited from @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/b > `optional` **fee**: `bigint` -Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) #### Inherited from @@ -114,7 +114,7 @@ Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) #### Inherited from @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/b > `optional` **jobTypes**: `string` -Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) +Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/b > **lockedUntilTimestamp**: `bigint` -Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) #### Inherited from @@ -146,7 +146,7 @@ Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/b > `optional` **name**: `string` -Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) #### Inherited from @@ -158,7 +158,7 @@ Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/b > `optional` **publicKey**: `string` -Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) #### Inherited from @@ -170,7 +170,7 @@ Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationInstructions**: `string` -Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) #### Inherited from @@ -182,7 +182,7 @@ Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationNeeded**: `boolean` -Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) #### Inherited from @@ -194,7 +194,7 @@ Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationNetworks**: `object`[] -Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) +Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) #### address @@ -206,7 +206,7 @@ Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/b > **reward**: `bigint` -Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) #### Inherited from @@ -218,7 +218,7 @@ Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/b > `optional` **role**: `string` -Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) #### Inherited from @@ -230,7 +230,7 @@ Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/b > `optional` **url**: `string` -Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) #### Inherited from @@ -242,7 +242,7 @@ Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/b > `optional` **webhookUrl**: `string` -Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) #### Inherited from @@ -254,7 +254,7 @@ Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/b > `optional` **website**: `string` -Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md index 4cd03b92c6..83f33768e3 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md @@ -6,7 +6,7 @@ # Interface: IOperatorsFilter -Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) +Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) +Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **minAmountStaked**: `number` -Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) +Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/b > `optional` **orderBy**: `string` -Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) +Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **roles**: `string`[] -Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) +Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) *** @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/b > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IPagination.md b/docs/sdk/typescript/interfaces/interfaces/IPagination.md index 75baa60993..530c9ce5c0 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPagination.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPagination.md @@ -6,7 +6,7 @@ # Interface: IPagination -Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L178) +Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L178) ## Extended by @@ -25,7 +25,7 @@ Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) *** @@ -33,7 +33,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) *** @@ -41,4 +41,4 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) diff --git a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md index 42e26b2ae7..0473bf2213 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md @@ -6,7 +6,7 @@ # Interface: IPayoutFilter -Defined in: [interfaces.ts:128](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L128) +Defined in: [interfaces.ts:128](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L128) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:128](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) +Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/ > `optional` **escrowAddress**: `string` -Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) +Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) +Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **recipient**: `string` -Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) +Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) *** @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) #### Inherited from @@ -86,4 +86,4 @@ Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) +Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md index 5d52f9d6ed..2780fd6b77 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md @@ -6,7 +6,7 @@ # Interface: IReputationNetwork -Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) +Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) *** @@ -30,4 +30,4 @@ Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/b > **operators**: [`IOperator`](IOperator.md)[] -Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) +Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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 00e8cb3037..e528bd0aaa 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md @@ -6,7 +6,7 @@ # Interface: IReputationNetworkSubgraph -Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) +Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) #### Inherited from @@ -42,4 +42,4 @@ Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/b > **operators**: [`IOperatorSubgraph`](IOperatorSubgraph.md)[] -Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) +Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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 72428ebceb..bc6fda7f62 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReward.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReward.md @@ -6,7 +6,7 @@ # Interface: IReward -Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) +Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/bl > **amount**: `bigint` -Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) +Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) *** @@ -22,4 +22,4 @@ Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/bl > **escrowAddress**: `string` -Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) +Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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 ba7080d45c..8b25b7ea19 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md @@ -6,7 +6,7 @@ # Interface: IStatisticsFilter -Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) +Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) +Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) #### Inherited from @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) #### Inherited from @@ -62,4 +62,4 @@ Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) +Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) diff --git a/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md b/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md index ded6770a37..1dd845aad6 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md @@ -6,7 +6,7 @@ # Interface: IStatusEventFilter -Defined in: [interfaces.ts:191](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L191) +Defined in: [interfaces.ts:191](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L191) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:191](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:192](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L192) +Defined in: [interfaces.ts:192](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L192) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:192](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:194](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L194) +Defined in: [interfaces.ts:194](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L194) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:194](https://github.com/humanprotocol/human-protocol/ > `optional` **launcher**: `string` -Defined in: [interfaces.ts:196](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L196) +Defined in: [interfaces.ts:196](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L196) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:196](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/ > `optional` **statuses**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md)[] -Defined in: [interfaces.ts:193](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L193) +Defined in: [interfaces.ts:193](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L193) *** @@ -86,4 +86,4 @@ Defined in: [interfaces.ts:193](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:195](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L195) +Defined in: [interfaces.ts:195](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L195) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md index f4c9e9b5ba..c92bc2a2a9 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md @@ -6,7 +6,7 @@ # Interface: ITransaction -Defined in: [interfaces.ts:151](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L151) +Defined in: [interfaces.ts:151](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L151) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:151](https://github.com/humanprotocol/human-protocol/ > **block**: `bigint` -Defined in: [interfaces.ts:152](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L152) +Defined in: [interfaces.ts:152](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L152) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:152](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) +Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/ > **from**: `string` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > **internalTransactions**: [`InternalTransaction`](InternalTransaction.md)[] -Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) +Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/ > **method**: `string` -Defined in: [interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) +Defined in: [interfaces.ts:158](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L158) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:158](https://github.com/humanprotocol/human-protocol/ > `optional` **receiver**: `string` -Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) +Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/ > **timestamp**: `bigint` -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > **to**: `string` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) +Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/ > **txHash**: `string` -Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) *** @@ -94,4 +94,4 @@ Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) +Defined in: [interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md index 48c918b5b7..634e671ea6 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md @@ -6,7 +6,7 @@ # Interface: ITransactionsFilter -Defined in: [interfaces.ts:165](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L165) +Defined in: [interfaces.ts:165](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L165) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:165](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) +Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/ > `optional` **endBlock**: `number` -Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L168) +Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L168) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/ > `optional` **endDate**: `Date` -Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L170) +Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L170) *** @@ -42,7 +42,7 @@ Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L174) +Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L174) *** @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) #### Inherited from @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **fromAddress**: `string` -Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L171) +Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L171) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/ > `optional` **method**: `string` -Defined in: [interfaces.ts:173](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L173) +Defined in: [interfaces.ts:173](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L173) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:173](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) #### Inherited from @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) #### Inherited from @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/ > `optional` **startBlock**: `number` -Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L167) +Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L167) *** @@ -110,7 +110,7 @@ Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/ > `optional` **startDate**: `Date` -Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L169) +Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L169) *** @@ -118,7 +118,7 @@ Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/ > `optional` **toAddress**: `string` -Defined in: [interfaces.ts:172](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L172) +Defined in: [interfaces.ts:172](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L172) *** @@ -126,4 +126,4 @@ Defined in: [interfaces.ts:172](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L175) +Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L175) diff --git a/docs/sdk/typescript/interfaces/interfaces/IWorker.md b/docs/sdk/typescript/interfaces/interfaces/IWorker.md index e089425555..a9961b927f 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IWorker.md +++ b/docs/sdk/typescript/interfaces/interfaces/IWorker.md @@ -6,7 +6,7 @@ # Interface: IWorker -Defined in: [interfaces.ts:199](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L199) +Defined in: [interfaces.ts:199](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L199) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:199](https://github.com/humanprotocol/human-protocol/ > **address**: `string` -Defined in: [interfaces.ts:201](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L201) +Defined in: [interfaces.ts:201](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L201) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:201](https://github.com/humanprotocol/human-protocol/ > **id**: `string` -Defined in: [interfaces.ts:200](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L200) +Defined in: [interfaces.ts:200](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L200) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:200](https://github.com/humanprotocol/human-protocol/ > **payoutCount**: `number` -Defined in: [interfaces.ts:203](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L203) +Defined in: [interfaces.ts:203](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L203) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:203](https://github.com/humanprotocol/human-protocol/ > **totalHMTAmountReceived**: `number` -Defined in: [interfaces.ts:202](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L202) +Defined in: [interfaces.ts:202](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L202) diff --git a/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md b/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md index ee156bb3f3..9d68da444b 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md @@ -6,7 +6,7 @@ # Interface: IWorkersFilter -Defined in: [interfaces.ts:206](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L206) +Defined in: [interfaces.ts:206](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L206) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:206](https://github.com/humanprotocol/human-protocol/ > `optional` **address**: `string` -Defined in: [interfaces.ts:208](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L208) +Defined in: [interfaces.ts:208](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L208) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:208](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:207](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L207) +Defined in: [interfaces.ts:207](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L207) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:207](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) +Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L179) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:179](https://github.com/humanprotocol/human-protocol/ > `optional` **orderBy**: `string` -Defined in: [interfaces.ts:209](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L209) +Defined in: [interfaces.ts:209](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L209) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:209](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) +Defined in: [interfaces.ts:180](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L180) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md index 7aea173e31..ec3144a58a 100644 --- a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md @@ -6,7 +6,7 @@ # Interface: InternalTransaction -Defined in: [interfaces.ts:141](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L141) +Defined in: [interfaces.ts:141](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L141) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:141](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) +Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/ > **from**: `string` -Defined in: [interfaces.ts:142](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L142) +Defined in: [interfaces.ts:142](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L142) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:142](https://github.com/humanprotocol/human-protocol/ > **method**: `string` -Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) +Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/ > `optional` **receiver**: `string` -Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) +Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/ > **to**: `string` -Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) +Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) +Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) *** @@ -62,4 +62,4 @@ Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) +Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) diff --git a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md index 5b1b553d62..2d2c36c5cd 100644 --- a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md +++ b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md @@ -6,7 +6,7 @@ # Interface: StakerInfo -Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L184) +Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L184) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/ > **lockedAmount**: `bigint` -Defined in: [interfaces.ts:186](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L186) +Defined in: [interfaces.ts:186](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L186) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:186](https://github.com/humanprotocol/human-protocol/ > **lockedUntil**: `bigint` -Defined in: [interfaces.ts:187](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L187) +Defined in: [interfaces.ts:187](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L187) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:187](https://github.com/humanprotocol/human-protocol/ > **stakedAmount**: `bigint` -Defined in: [interfaces.ts:185](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L185) +Defined in: [interfaces.ts:185](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L185) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:185](https://github.com/humanprotocol/human-protocol/ > **withdrawableAmount**: `bigint` -Defined in: [interfaces.ts:188](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L188) +Defined in: [interfaces.ts:188](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L188) diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md index 29a0802e56..6e2f59da7c 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md @@ -6,7 +6,7 @@ # Class: KVStoreClient -Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) +Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) ## Introduction @@ -86,7 +86,7 @@ const kvstoreClient = await KVStoreClient.build(provider); > **new KVStoreClient**(`runner`, `networkData`): `KVStoreClient` -Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) +Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) **KVStoreClient constructor** @@ -118,7 +118,7 @@ The network information required to connect to the KVStore contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from @@ -130,7 +130,7 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9d > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from @@ -142,7 +142,7 @@ Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/9d > **set**(`key`, `value`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) +Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. @@ -196,7 +196,7 @@ await kvstoreClient.set('Role', 'RecordingOracle'); > **setBulk**(`keys`, `values`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) +Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. @@ -252,7 +252,7 @@ await kvstoreClient.setBulk(keys, values); > **setFileUrlAndHash**(`url`, `urlKey`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) +Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) Sets a URL value for the address that submits the transaction, and its hash. @@ -305,7 +305,7 @@ await kvstoreClient.setFileUrlAndHash('linkedin.com/example', 'linkedin_url'); > `static` **build**(`runner`): `Promise`\<`KVStoreClient`\> -Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) +Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) Creates an instance of KVStoreClient from a runner. diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md index e1869bfefb..1e196c40a1 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md @@ -6,7 +6,7 @@ # Class: KVStoreUtils -Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) +Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) ## Introduction @@ -55,7 +55,7 @@ const KVStoreAddresses = await KVStoreUtils.getKVStoreData( > `static` **get**(`chainId`, `address`, `key`): `Promise`\<`string`\> -Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) +Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) Gets the value of a key-value pair in the KVStore using the subgraph. @@ -116,7 +116,7 @@ console.log(value); > `static` **getFileUrlAndVerifyHash**(`chainId`, `address`, `urlKey`): `Promise`\<`string`\> -Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) +Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) Gets the URL value of the given entity, and verifies its hash. @@ -164,7 +164,7 @@ console.log(url); > `static` **getKVStoreData**(`chainId`, `address`): `Promise`\<[`IKVStore`](../../interfaces/interfaces/IKVStore.md)[]\> -Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) +Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) This function returns the KVStore data for a given address. @@ -211,7 +211,7 @@ console.log(kvStoreData); > `static` **getPublicKey**(`chainId`, `address`): `Promise`\<`string`\> -Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) +Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) Gets the public key of the given entity, and verifies its hash. diff --git a/docs/sdk/typescript/operator/classes/OperatorUtils.md b/docs/sdk/typescript/operator/classes/OperatorUtils.md index ae01680de8..02419b5841 100644 --- a/docs/sdk/typescript/operator/classes/OperatorUtils.md +++ b/docs/sdk/typescript/operator/classes/OperatorUtils.md @@ -6,7 +6,7 @@ # Class: OperatorUtils -Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) +Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) ## Constructors @@ -24,7 +24,7 @@ Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blo > `static` **getOperator**(`chainId`, `address`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)\> -Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) +Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) This function returns the operator data for the given address. @@ -62,7 +62,7 @@ const operator = await OperatorUtils.getOperator(ChainId.POLYGON_AMOY, '0x62dD51 > `static` **getOperators**(`filter`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) +Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) This function returns all the operator details of the protocol. @@ -97,7 +97,7 @@ const operators = await OperatorUtils.getOperators(filter); > `static` **getReputationNetworkOperators**(`chainId`, `address`, `role?`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) +Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) Retrieves the reputation network operators of the specified address. @@ -141,7 +141,7 @@ const operators = await OperatorUtils.getReputationNetworkOperators(ChainId.POLY > `static` **getRewards**(`chainId`, `slasherAddress`): `Promise`\<[`IReward`](../../interfaces/interfaces/IReward.md)[]\> -Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) +Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) This function returns information about the rewards for a given slasher address. diff --git a/docs/sdk/typescript/staking/classes/StakingClient.md b/docs/sdk/typescript/staking/classes/StakingClient.md index 17a9fd7b36..05b4971076 100644 --- a/docs/sdk/typescript/staking/classes/StakingClient.md +++ b/docs/sdk/typescript/staking/classes/StakingClient.md @@ -6,7 +6,7 @@ # Class: StakingClient -Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) +Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) ## Introduction @@ -86,7 +86,7 @@ const stakingClient = await StakingClient.build(provider); > **new StakingClient**(`runner`, `networkData`): `StakingClient` -Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) +Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) **StakingClient constructor** @@ -118,7 +118,7 @@ The network information required to connect to the Staking contract > **escrowFactoryContract**: `EscrowFactory` -Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) +Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) *** @@ -126,7 +126,7 @@ Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blo > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from @@ -138,7 +138,7 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9d > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from @@ -150,7 +150,7 @@ Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/9d > **stakingContract**: `Staking` -Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) +Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) *** @@ -158,7 +158,7 @@ Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob > **tokenContract**: `HMToken` -Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) +Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) ## Methods @@ -166,7 +166,7 @@ Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob > **approveStake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) +Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. @@ -213,7 +213,7 @@ await stakingClient.approveStake(amount); > **getStakerInfo**(`stakerAddress`): `Promise`\<[`StakerInfo`](../../interfaces/interfaces/StakerInfo.md)\> -Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) +Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) Retrieves comprehensive staking information for a staker. @@ -249,7 +249,7 @@ console.log(stakingInfo.tokensStaked); > **slash**(`slasher`, `staker`, `escrowAddress`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) +Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. @@ -314,7 +314,7 @@ await stakingClient.slash('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd > **stake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) +Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) This function stakes a specified amount of tokens on a specific network. @@ -364,7 +364,7 @@ await stakingClient.stake(amount); > **unstake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) +Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. @@ -413,7 +413,7 @@ await stakingClient.unstake(amount); > **withdraw**(`txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) +Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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. @@ -455,7 +455,7 @@ await stakingClient.withdraw(); > `static` **build**(`runner`): `Promise`\<`StakingClient`\> -Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) +Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) Creates an instance of StakingClient from a Runner. diff --git a/docs/sdk/typescript/statistics/classes/StatisticsClient.md b/docs/sdk/typescript/statistics/classes/StatisticsClient.md index 4ec52d9ef6..991c33261d 100644 --- a/docs/sdk/typescript/statistics/classes/StatisticsClient.md +++ b/docs/sdk/typescript/statistics/classes/StatisticsClient.md @@ -6,7 +6,7 @@ # Class: StatisticsClient -Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) +Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) ## Introduction @@ -45,7 +45,7 @@ const statisticsClient = new StatisticsClient(NETWORKS[ChainId.POLYGON_AMOY]); > **new StatisticsClient**(`networkData`): `StatisticsClient` -Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) +Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) **StatisticsClient constructor** @@ -67,7 +67,7 @@ The network information required to connect to the Statistics contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) +Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) *** @@ -75,7 +75,7 @@ Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/b > **subgraphUrl**: `string` -Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) +Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) ## Methods @@ -83,7 +83,7 @@ Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/b > **getEscrowStatistics**(`filter`): `Promise`\<[`EscrowStatistics`](../../graphql/types/type-aliases/EscrowStatistics.md)\> -Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) +Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) This function returns the statistical data of escrows. @@ -149,7 +149,7 @@ const escrowStatisticsApril = await statisticsClient.getEscrowStatistics({ > **getHMTDailyData**(`filter`): `Promise`\<[`DailyHMTData`](../../graphql/types/type-aliases/DailyHMTData.md)[]\> -Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) +Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) This function returns the statistical data of HMToken day by day. @@ -214,7 +214,7 @@ console.log('HMT statistics from 5/8 - 6/8:', hmtStatisticsRange); > **getHMTHolders**(`params`): `Promise`\<[`HMTHolder`](../../graphql/types/type-aliases/HMTHolder.md)[]\> -Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) +Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) This function returns the holders of the HMToken with optional filters and ordering. @@ -257,7 +257,7 @@ console.log('HMT holders:', hmtHolders.map((h) => ({ > **getHMTStatistics**(): `Promise`\<[`HMTStatistics`](../../graphql/types/type-aliases/HMTStatistics.md)\> -Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) +Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) This function returns the statistical data of HMToken. @@ -296,7 +296,7 @@ console.log('HMT statistics:', { > **getPaymentStatistics**(`filter`): `Promise`\<[`PaymentStatistics`](../../graphql/types/type-aliases/PaymentStatistics.md)\> -Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) +Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) This function returns the statistical data of payments. @@ -380,7 +380,7 @@ console.log( > **getWorkerStatistics**(`filter`): `Promise`\<[`WorkerStatistics`](../../graphql/types/type-aliases/WorkerStatistics.md)\> -Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) +Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) This function returns the statistical data of workers. diff --git a/docs/sdk/typescript/storage/classes/StorageClient.md b/docs/sdk/typescript/storage/classes/StorageClient.md index 4fd294967f..8179b8f93e 100644 --- a/docs/sdk/typescript/storage/classes/StorageClient.md +++ b/docs/sdk/typescript/storage/classes/StorageClient.md @@ -6,7 +6,7 @@ # Class: ~~StorageClient~~ -Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) +Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) ## Deprecated @@ -61,7 +61,7 @@ const storageClient = new StorageClient(params, credentials); > **new StorageClient**(`params`, `credentials?`): `StorageClient` -Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) +Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) **Storage client constructor** @@ -89,7 +89,7 @@ Optional. Cloud storage access data. If credentials are not provided - use anony > **bucketExists**(`bucket`): `Promise`\<`boolean`\> -Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) +Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) This function checks if a bucket exists. @@ -133,7 +133,7 @@ const exists = await storageClient.bucketExists('bucket-name'); > **downloadFiles**(`keys`, `bucket`): `Promise`\<`any`[]\> -Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) +Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) This function downloads files from a bucket. @@ -181,7 +181,7 @@ const files = await storageClient.downloadFiles(keys, 'bucket-name'); > **listObjects**(`bucket`): `Promise`\<`string`[]\> -Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) +Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) This function lists all file names contained in the bucket. @@ -225,7 +225,7 @@ const fileNames = await storageClient.listObjects('bucket-name'); > **uploadFiles**(`files`, `bucket`): `Promise`\<[`UploadFile`](../../types/type-aliases/UploadFile.md)[]\> -Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) +Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) This function uploads files to a bucket. @@ -278,7 +278,7 @@ const uploadedFiles = await storageClient.uploadFiles(files, 'bucket-name'); > `static` **downloadFileFromUrl**(`url`): `Promise`\<`any`\> -Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) +Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) This function downloads files from a URL. diff --git a/docs/sdk/typescript/transaction/classes/TransactionUtils.md b/docs/sdk/typescript/transaction/classes/TransactionUtils.md index 77470e7087..2e10c01a93 100644 --- a/docs/sdk/typescript/transaction/classes/TransactionUtils.md +++ b/docs/sdk/typescript/transaction/classes/TransactionUtils.md @@ -6,7 +6,7 @@ # Class: TransactionUtils -Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) +Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) ## Constructors @@ -24,7 +24,7 @@ Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/ > `static` **getTransaction**(`chainId`, `hash`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)\> -Defined in: [transaction.ts:50](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L50) +Defined in: [transaction.ts:50](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L50) This function returns the transaction data for the given hash. @@ -78,7 +78,7 @@ const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62 > `static` **getTransactions**(`filter`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)[]\> -Defined in: [transaction.ts:132](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L132) +Defined in: [transaction.ts:132](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L132) This function returns all transaction details based on the provided filter. diff --git a/docs/sdk/typescript/types/enumerations/EscrowStatus.md b/docs/sdk/typescript/types/enumerations/EscrowStatus.md index 716cac332f..c81a7b414e 100644 --- a/docs/sdk/typescript/types/enumerations/EscrowStatus.md +++ b/docs/sdk/typescript/types/enumerations/EscrowStatus.md @@ -6,7 +6,7 @@ # Enumeration: EscrowStatus -Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) +Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) Enum for escrow statuses. @@ -16,7 +16,7 @@ Enum for escrow statuses. > **Cancelled**: `5` -Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) +Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) Escrow is cancelled. @@ -26,7 +26,7 @@ Escrow is cancelled. > **Complete**: `4` -Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) +Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) Escrow is finished. @@ -36,7 +36,7 @@ Escrow is finished. > **Launched**: `0` -Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) +Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) Escrow is launched. @@ -46,7 +46,7 @@ Escrow is launched. > **Paid**: `3` -Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) +Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) Escrow is fully paid. @@ -56,7 +56,7 @@ Escrow is fully paid. > **Partial**: `2` -Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) +Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) Escrow is partially paid out. @@ -66,6 +66,6 @@ Escrow is partially paid out. > **Pending**: `1` -Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) +Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/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 8cdbec8abc..fce3a47bd2 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md @@ -8,7 +8,7 @@ > **EscrowCancel** = `object` -Defined in: [types.ts:145](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) +Defined in: [types.ts:145](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) Represents the response data for an escrow cancellation. @@ -18,7 +18,7 @@ Represents the response data for an escrow cancellation. > **amountRefunded**: `bigint` -Defined in: [types.ts:153](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L153) +Defined in: [types.ts:153](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L153) The amount refunded in the escrow cancellation. @@ -28,6 +28,6 @@ The amount refunded in the escrow cancellation. > **txHash**: `string` -Defined in: [types.ts:149](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L149) +Defined in: [types.ts:149](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L149) The hash of the transaction associated with the escrow cancellation. diff --git a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md index 8706f5b8a6..9b87c31b3d 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md @@ -8,7 +8,7 @@ > **EscrowWithdraw** = `object` -Defined in: [types.ts:159](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) +Defined in: [types.ts:159](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) Represents the response data for an escrow withdrawal. @@ -18,7 +18,7 @@ Represents the response data for an escrow withdrawal. > **amountWithdrawn**: `bigint` -Defined in: [types.ts:171](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L171) +Defined in: [types.ts:171](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L171) The amount withdrawn from the escrow. @@ -28,7 +28,7 @@ The amount withdrawn from the escrow. > **tokenAddress**: `string` -Defined in: [types.ts:167](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L167) +Defined in: [types.ts:167](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L167) The address of the token used for the withdrawal. @@ -38,6 +38,6 @@ The address of the token used for the withdrawal. > **txHash**: `string` -Defined in: [types.ts:163](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L163) +Defined in: [types.ts:163](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L163) The hash of the transaction associated with the escrow withdrawal. diff --git a/docs/sdk/typescript/types/type-aliases/NetworkData.md b/docs/sdk/typescript/types/type-aliases/NetworkData.md index a2276446b6..b27fe57abf 100644 --- a/docs/sdk/typescript/types/type-aliases/NetworkData.md +++ b/docs/sdk/typescript/types/type-aliases/NetworkData.md @@ -8,7 +8,7 @@ > **NetworkData** = `object` -Defined in: [types.ts:95](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) +Defined in: [types.ts:95](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) Network data @@ -18,7 +18,7 @@ Network data > **chainId**: `number` -Defined in: [types.ts:99](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L99) +Defined in: [types.ts:99](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L99) Network chain id @@ -28,7 +28,7 @@ Network chain id > **factoryAddress**: `string` -Defined in: [types.ts:115](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L115) +Defined in: [types.ts:115](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L115) Escrow Factory contract address @@ -38,7 +38,7 @@ Escrow Factory contract address > **hmtAddress**: `string` -Defined in: [types.ts:111](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L111) +Defined in: [types.ts:111](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L111) HMT Token contract address @@ -48,7 +48,7 @@ HMT Token contract address > **kvstoreAddress**: `string` -Defined in: [types.ts:123](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L123) +Defined in: [types.ts:123](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L123) KVStore contract address @@ -58,7 +58,7 @@ KVStore contract address > **oldFactoryAddress**: `string` -Defined in: [types.ts:139](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L139) +Defined in: [types.ts:139](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L139) Old Escrow Factory contract address @@ -68,7 +68,7 @@ Old Escrow Factory contract address > **oldSubgraphUrl**: `string` -Defined in: [types.ts:135](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L135) +Defined in: [types.ts:135](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L135) Old subgraph URL @@ -78,7 +78,7 @@ Old subgraph URL > **scanUrl**: `string` -Defined in: [types.ts:107](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L107) +Defined in: [types.ts:107](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L107) Network scanner URL @@ -88,7 +88,7 @@ Network scanner URL > **stakingAddress**: `string` -Defined in: [types.ts:119](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L119) +Defined in: [types.ts:119](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L119) Staking contract address @@ -98,7 +98,7 @@ Staking contract address > **subgraphUrl**: `string` -Defined in: [types.ts:127](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L127) +Defined in: [types.ts:127](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L127) Subgraph URL @@ -108,7 +108,7 @@ Subgraph URL > **subgraphUrlApiKey**: `string` -Defined in: [types.ts:131](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L131) +Defined in: [types.ts:131](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L131) Subgraph URL API key @@ -118,6 +118,6 @@ Subgraph URL API key > **title**: `string` -Defined in: [types.ts:103](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L103) +Defined in: [types.ts:103](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L103) Network title diff --git a/docs/sdk/typescript/types/type-aliases/Payout.md b/docs/sdk/typescript/types/type-aliases/Payout.md index d366f1118f..0def0bf50f 100644 --- a/docs/sdk/typescript/types/type-aliases/Payout.md +++ b/docs/sdk/typescript/types/type-aliases/Payout.md @@ -8,7 +8,7 @@ > **Payout** = `object` -Defined in: [types.ts:177](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L177) +Defined in: [types.ts:177](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L177) Represents a payout from an escrow. @@ -18,7 +18,7 @@ Represents a payout from an escrow. > **amount**: `bigint` -Defined in: [types.ts:193](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L193) +Defined in: [types.ts:193](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L193) The amount paid to the recipient. @@ -28,7 +28,7 @@ The amount paid to the recipient. > **createdAt**: `number` -Defined in: [types.ts:197](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L197) +Defined in: [types.ts:197](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L197) The timestamp when the payout was created (in UNIX format). @@ -38,7 +38,7 @@ The timestamp when the payout was created (in UNIX format). > **escrowAddress**: `string` -Defined in: [types.ts:185](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L185) +Defined in: [types.ts:185](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L185) The address of the escrow associated with the payout. @@ -48,7 +48,7 @@ The address of the escrow associated with the payout. > **id**: `string` -Defined in: [types.ts:181](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L181) +Defined in: [types.ts:181](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L181) Unique identifier of the payout. @@ -58,6 +58,6 @@ Unique identifier of the payout. > **recipient**: `string` -Defined in: [types.ts:189](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L189) +Defined in: [types.ts:189](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L189) The address of the recipient who received the payout. diff --git a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md index c87013b209..014bc1fd90 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md +++ b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md @@ -8,7 +8,7 @@ > `readonly` **StorageCredentials** = `object` -Defined in: [types.ts:40](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) +Defined in: [types.ts:40](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) AWS/GCP cloud storage access data @@ -22,7 +22,7 @@ StorageClient is deprecated. Use Minio.Client directly. > **accessKey**: `string` -Defined in: [types.ts:44](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L44) +Defined in: [types.ts:44](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L44) Access Key @@ -32,6 +32,6 @@ Access Key > **secretKey**: `string` -Defined in: [types.ts:48](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L48) +Defined in: [types.ts:48](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L48) Secret Key diff --git a/docs/sdk/typescript/types/type-aliases/StorageParams.md b/docs/sdk/typescript/types/type-aliases/StorageParams.md index 87f599ea09..5762aa1e32 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageParams.md +++ b/docs/sdk/typescript/types/type-aliases/StorageParams.md @@ -8,7 +8,7 @@ > **StorageParams** = `object` -Defined in: [types.ts:54](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) +Defined in: [types.ts:54](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) ## Deprecated @@ -20,7 +20,7 @@ StorageClient is deprecated. Use Minio.Client directly. > **endPoint**: `string` -Defined in: [types.ts:58](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L58) +Defined in: [types.ts:58](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L58) Request endPoint @@ -30,7 +30,7 @@ Request endPoint > `optional` **port**: `number` -Defined in: [types.ts:70](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L70) +Defined in: [types.ts:70](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L70) TCP/IP port number. Default value set to 80 for HTTP and 443 for HTTPs @@ -40,7 +40,7 @@ TCP/IP port number. Default value set to 80 for HTTP and 443 for HTTPs > `optional` **region**: `string` -Defined in: [types.ts:66](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L66) +Defined in: [types.ts:66](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L66) Region @@ -50,6 +50,6 @@ Region > **useSSL**: `boolean` -Defined in: [types.ts:62](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L62) +Defined in: [types.ts:62](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L62) Enable secure (HTTPS) access. Default value set to false diff --git a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md index a98655afd0..05ffee5fe5 100644 --- a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md +++ b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md @@ -8,7 +8,7 @@ > **TransactionLikeWithNonce** = `TransactionLike` & `object` -Defined in: [types.ts:200](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L200) +Defined in: [types.ts:200](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L200) ## Type declaration diff --git a/docs/sdk/typescript/types/type-aliases/UploadFile.md b/docs/sdk/typescript/types/type-aliases/UploadFile.md index 7862bb8c22..5aa10a9e34 100644 --- a/docs/sdk/typescript/types/type-aliases/UploadFile.md +++ b/docs/sdk/typescript/types/type-aliases/UploadFile.md @@ -8,7 +8,7 @@ > `readonly` **UploadFile** = `object` -Defined in: [types.ts:77](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) +Defined in: [types.ts:77](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) Upload file data @@ -18,7 +18,7 @@ Upload file data > **hash**: `string` -Defined in: [types.ts:89](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L89) +Defined in: [types.ts:89](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L89) Hash of uploaded object key @@ -28,7 +28,7 @@ Hash of uploaded object key > **key**: `string` -Defined in: [types.ts:81](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L81) +Defined in: [types.ts:81](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L81) Uploaded object key @@ -38,6 +38,6 @@ Uploaded object key > **url**: `string` -Defined in: [types.ts:85](https://github.com/humanprotocol/human-protocol/blob/9da418b6962e251427442717195921599d2815f2/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L85) +Defined in: [types.ts:85](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L85) Uploaded object URL 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 4a07ab3dd1..9073407ca7 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 @@ -147,7 +147,7 @@ describe('JobService', () => { beforeAll(async () => { jest.spyOn(jobRepository, 'createUnique'); (EscrowClient.build as any).mockImplementation(() => ({ - getManifestUrl: jest.fn().mockResolvedValue(MOCK_MANIFEST_URL), + getManifest: jest.fn().mockResolvedValue(MOCK_MANIFEST_URL), getReputationOracleAddress: jest .fn() .mockResolvedValue(reputationNetwork), 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 3b89ea8a23..7089fed2a2 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 @@ -78,7 +78,7 @@ export class JobService { const newJobEntity = new JobEntity(); newJobEntity.escrowAddress = escrowAddress; - newJobEntity.manifestUrl = await escrowClient.getManifestUrl(escrowAddress); + newJobEntity.manifestUrl = await escrowClient.getManifest(escrowAddress); newJobEntity.chainId = chainId; newJobEntity.rewardToken = await tokenContract.symbol(); newJobEntity.status = JobStatus.ACTIVE; diff --git a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.spec.ts b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.spec.ts index 8baeb91adb..f425cb9ab5 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.spec.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.spec.ts @@ -182,9 +182,7 @@ describe('JobService', () => { const escrowClient = { getRecordingOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), }; (EscrowClient.build as jest.Mock).mockResolvedValue(escrowClient); StorageClient.downloadFileFromUrl = jest @@ -212,9 +210,7 @@ describe('JobService', () => { const escrowClient = { getRecordingOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), }; (EscrowClient.build as jest.Mock).mockResolvedValue(escrowClient); StorageClient.downloadFileFromUrl = jest @@ -246,9 +242,7 @@ describe('JobService', () => { const escrowClient = { getRecordingOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), getIntermediateResultsUrl: jest .fn() .mockResolvedValue('http://example.com/results'), @@ -312,9 +306,7 @@ describe('JobService', () => { getRecordingOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getReputationOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), getIntermediateResultsUrl: jest .fn() .mockResolvedValue('http://example.com/results'), @@ -370,9 +362,7 @@ describe('JobService', () => { getRecordingOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getReputationOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), getIntermediateResultsUrl: jest.fn().mockResolvedValue(''), storeResults: jest.fn().mockResolvedValue(true), }; @@ -426,9 +416,7 @@ describe('JobService', () => { getRecordingOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getReputationOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), getIntermediateResultsUrl: jest .fn() .mockResolvedValue('http://existing-solutions'), @@ -506,9 +494,7 @@ describe('JobService', () => { getRecordingOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getReputationOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), getIntermediateResultsUrl: jest .fn() .mockResolvedValue('http://existing-solutions'), @@ -598,9 +584,7 @@ describe('JobService', () => { getExchangeOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getReputationOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), getIntermediateResultsUrl: jest .fn() .mockResolvedValue('http://existing-solutions'), @@ -682,9 +666,7 @@ describe('JobService', () => { getExchangeOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getReputationOracleAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), - getManifestUrl: jest - .fn() - .mockResolvedValue('http://example.com/manifest'), + getManifest: jest.fn().mockResolvedValue('http://example.com/manifest'), getIntermediateResultsUrl: jest .fn() .mockResolvedValue('http://existing-solutions'), diff --git a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts index 439952805c..687dc91c89 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts @@ -119,9 +119,7 @@ export class JobService { throw new ConflictError(ErrorJob.InvalidStatus); } - const manifestUrl = await escrowClient.getManifestUrl( - webhook.escrowAddress, - ); + const manifestUrl = await escrowClient.getManifest(webhook.escrowAddress); const { submissionsRequired, requestType }: IManifest = await this.storageService.download(manifestUrl); diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts index 66072ac3ff..85b530fd0f 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts @@ -909,7 +909,7 @@ describe('JobService', () => { recordingOracleFee: 2n, exchangeOracle: jobEntity.exchangeOracle, exchangeOracleFee: 3n, - manifestUrl: jobEntity.manifestUrl, + manifest: jobEntity.manifestUrl, manifestHash: jobEntity.manifestHash, }, { gasPrice: 1n }, diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.ts index b619abbcb9..867ce88a90 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.ts @@ -369,7 +369,7 @@ export class JobService { jobEntity.exchangeOracle, jobEntity.chainId, ), - manifestUrl: jobEntity.manifestUrl, + manifest: jobEntity.manifestUrl, manifestHash: jobEntity.manifestHash, }; diff --git a/packages/apps/reputation-oracle/server/src/modules/abuse/abuse.service.ts b/packages/apps/reputation-oracle/server/src/modules/abuse/abuse.service.ts index 1ac68c5f12..38d1d206c5 100644 --- a/packages/apps/reputation-oracle/server/src/modules/abuse/abuse.service.ts +++ b/packages/apps/reputation-oracle/server/src/modules/abuse/abuse.service.ts @@ -194,7 +194,7 @@ export class AbuseService { abuseId: abuseEntity.id, chainId: abuseEntity.chainId, escrowAddress: abuseEntity.escrowAddress, - manifestUrl: escrow.manifestUrl as string, + manifestUrl: escrow.manifest as string, }); abuseEntity.status = AbuseStatus.NOTIFIED; await this.abuseRepository.updateOne(abuseEntity); diff --git a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.spec.ts b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.spec.ts index eeabf34dfa..7a26a8ab24 100644 --- a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.spec.ts +++ b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.spec.ts @@ -311,7 +311,9 @@ describe('EscrowCompletionService', () => { mockGetEscrowStatus.mockResolvedValue(EscrowStatus.Pending); const manifestUrl = faker.internet.url(); - mockedEscrowUtils.getEscrow.mockResolvedValueOnce({ manifestUrl } as any); + mockedEscrowUtils.getEscrow.mockResolvedValueOnce({ + manifest: manifestUrl, + } as any); const fortuneManifest = generateFortuneManifest(); mockStorageService.downloadJsonLikeData.mockResolvedValueOnce( diff --git a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts index d0a4cdd285..af91eb0d7f 100644 --- a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts +++ b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts @@ -128,7 +128,7 @@ export class EscrowCompletionService { ); const manifest = await this.storageService.downloadJsonLikeData( - escrowData.manifestUrl as string, + escrowData.manifest as string, ); const jobRequestType = manifestUtils.getJobRequestType(manifest); diff --git a/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.decorators.rst b/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.decorators.rst new file mode 100644 index 0000000000..40a6fe5c3b --- /dev/null +++ b/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.decorators.rst @@ -0,0 +1,7 @@ +human\_protocol\_sdk.decorators module +====================================== + +.. automodule:: human_protocol_sdk.decorators + :members: + :undoc-members: + :show-inheritance: diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/constants.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/constants.py index 8fdbc5de08..ff063c873b 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/constants.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/constants.py @@ -37,7 +37,7 @@ class OperatorCategory(Enum): "https://api.studio.thegraph.com/query/74256/ethereum/version/latest" ), "subgraph_url_api_key": ( - "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmSxVvFd4STZkR9gwfuJ76YUpYGcWcBJ6Sm3kqBJHFdUw2" + "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmQwp4Rr2J4UbPFykb9eXg2t7GPcGRS6WT7QzExZtv32jK" ), "hmt_address": "0xd1ba9BAC957322D6e8c07a160a3A8dA11A0d2867", "factory_address": "0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a", @@ -53,7 +53,7 @@ class OperatorCategory(Enum): "https://api.studio.thegraph.com/query/74256/sepolia/version/latest" ), "subgraph_url_api_key": ( - "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmP3Ma4hZ6ZBxNTL2ip2BCkB33vMgRKRLpw74KcwZShzvk" + "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmURrhnEXimGnRzjeN3B4VMmioUeBHUBg4WJ7KZzJ7em8g" ), "hmt_address": "0x792abbcC99c01dbDec49c9fa9A828a186Da45C33", "factory_address": "0x5987A5558d961ee674efe4A8c8eB7B1b5495D3bf", @@ -69,7 +69,7 @@ class OperatorCategory(Enum): "https://api.studio.thegraph.com/query/74256/bsc/version/latest" ), "subgraph_url_api_key": ( - "hthttps://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmW54Mzx63QNVdvk2V9kRaoHicfeJFuDSt7xSGDHpZg9AW" + "hthttps://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmT2VoBLjAfc4pQzDmeCGra6weoLuk2jPRgnRz5iSMUw1t" ), "hmt_address": "0x711Fd6ab6d65A98904522d4e3586F492B989c527", "factory_address": "0x92FD968AcBd521c232f5fB8c33b342923cC72714", @@ -85,7 +85,7 @@ class OperatorCategory(Enum): "https://api.studio.thegraph.com/query/74256/bsc-testnet/version/latest" ), "subgraph_url_api_key": ( - "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWaq9orii1Xkw9uCVJ7akDnjY2fuewBRU5LiUKT12XVui" + "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmZHqbiyAAwrmqsVJLhTEdejVGYJpXfJAkJXUw7C2VV1TD" ), "hmt_address": "0xE3D74BBFa45B4bCa69FF28891fBE392f4B4d4e4d", "factory_address": "0x2bfA592DBDaF434DDcbb893B1916120d181DAD18", @@ -103,7 +103,7 @@ class OperatorCategory(Enum): "https://api.studio.thegraph.com/query/74256/polygon/version/latest" ), "subgraph_url_api_key": ( - "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmVmsQCdB3dGjt9tKG2Y96PRsHUCgGPK8oWtyVw8HMypTc" + "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmT72ecfx6Zaje21kLNi17kDJTpPKFYvzQETDyLpQgDrPu" ), "hmt_address": "0xc748B2A084F8eFc47E086ccdDD9b7e67aEb571BF", "factory_address": "0xBDBfD2cC708199C5640C6ECdf3B0F4A4C67AdfcB", @@ -121,7 +121,7 @@ class OperatorCategory(Enum): "https://api.studio.thegraph.com/query/74256/amoy/version/latest" ), "subgraph_url_api_key": ( - "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmPD243cnyp6ApUT2zpsNLKmtM75RLHNwUGT7NRTDds7QN" + "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmeeE9bVkat1mkbQg1R6SXLuLadXxoNCY5b7CEQkmu6cQi" ), "hmt_address": "0x792abbcC99c01dbDec49c9fa9A828a186Da45C33", "factory_address": "0xAFf5a986A530ff839d49325A5dF69F96627E8D29", @@ -137,7 +137,7 @@ class OperatorCategory(Enum): "https://api.studio.thegraph.com/query/74256/amoy/version/aurora-testnet" ), "subgraph_url_api_key": ( - "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmVQuank2mwaZg3mcLUH15QEP8KaVS4NNsRaWxnq5mRWoo" + "https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmQiLaFKusXLzKrpZvQDg7vETLhdfPgzWJN3Uxp3bE9K9W" ), "hmt_address": "0x792abbcC99c01dbDec49c9fa9A828a186Da45C33", "factory_address": "0xbA537fEF2442cD48f60686FE1Bbbe40F964a7940", diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py index b591fb5671..234e6842eb 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py @@ -67,6 +67,7 @@ def get_w3_with_priv_key(priv_key: str): get_factory_interface, get_erc20_interface, handle_error, + validate_json, ) from web3 import Web3, contract from web3 import eth @@ -127,7 +128,7 @@ def __init__( recording_oracle_fee: Decimal, reputation_oracle_fee: Decimal, exchange_oracle_fee: Decimal, - manifest_url: str, + manifest: str, hash: str, ): """ @@ -137,7 +138,7 @@ def __init__( :param reputation_oracle_address: Address of the Reputation Oracle :param recording_oracle_fee: Fee percentage of the Recording Oracle :param reputation_oracle_fee: Fee percentage of the Reputation Oracle - :param manifest_url: Manifest file url + :param manifest: Manifest data (can be a URL or JSON string) :param hash: Manifest file hash """ if not Web3.is_address(recording_oracle_address): @@ -161,8 +162,8 @@ def __init__( raise EscrowClientError("Fee must be between 0 and 100") if recording_oracle_fee + reputation_oracle_fee + exchange_oracle_fee > 100: raise EscrowClientError("Total fee must be less than 100") - if not validate_url(manifest_url): - raise EscrowClientError(f"Invalid manifest URL: {manifest_url}") + if not validate_url(manifest) and not validate_json(manifest): + raise EscrowClientError("Invalid empty manifest") if not hash: raise EscrowClientError("Invalid empty manifest hash") @@ -172,7 +173,7 @@ def __init__( self.recording_oracle_fee = recording_oracle_fee self.reputation_oracle_fee = reputation_oracle_fee self.exchange_oracle_fee = exchange_oracle_fee - self.manifest_url = manifest_url + self.manifest = manifest self.hash = hash @@ -362,7 +363,7 @@ def get_w3_with_priv_key(priv_key: str): escrow_config.reputation_oracle_fee, escrow_config.recording_oracle_fee, escrow_config.exchange_oracle_fee, - escrow_config.manifest_url, + escrow_config.manifest, escrow_config.hash, ) .transact(tx_options or {}) @@ -1138,13 +1139,13 @@ def get_manifest_hash(self, escrow_address: str) -> str: return self._get_escrow_contract(escrow_address).functions.manifestHash().call() - def get_manifest_url(self, escrow_address: str) -> str: + def get_manifest(self, escrow_address: str) -> str: """ - Gets the manifest file URL. + Gets the manifest data (can be a URL or JSON string). :param escrow_address: Address of the escrow - :return str: Manifest file url + :return str: Manifest data :raise EscrowClientError: If an error occurs while checking the parameters @@ -1160,7 +1161,7 @@ def get_manifest_url(self, escrow_address: str) -> str: w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) escrow_client = EscrowClient(w3) - url = escrow_client.get_manifest_url( + manifest = escrow_client.get_manifest( "0x62dD51230A30401C455c8398d06F85e4EaB6309f" ) """ diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py index 35e6d1ed8f..ca0a5ac9ed 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py @@ -60,7 +60,7 @@ def __init__( final_results_url: Optional[str] = None, intermediate_results_url: Optional[str] = None, manifest_hash: Optional[str] = None, - manifest_url: Optional[str] = None, + manifest: Optional[str] = None, recording_oracle: Optional[str] = None, reputation_oracle: Optional[str] = None, exchange_oracle: Optional[str] = None, @@ -83,7 +83,7 @@ def __init__( :param final_results_url: URL for final results. :param intermediate_results_url: URL for intermediate results. :param manifest_hash: Manifest hash. - :param manifest_url: Manifest URL. + :param manifest: Manifest data (JSON/URL). :param recording_oracle: Recording Oracle address. :param reputation_oracle: Reputation Oracle address. :param exchange_oracle: Exchange Oracle address. @@ -99,7 +99,7 @@ def __init__( self.intermediate_results_url = intermediate_results_url self.launcher = launcher self.manifest_hash = manifest_hash - self.manifest_url = manifest_url + self.manifest = manifest self.recording_oracle = recording_oracle self.reputation_oracle = reputation_oracle self.exchange_oracle = exchange_oracle @@ -253,7 +253,7 @@ def get_escrows( final_results_url=escrow.get("finalResultsUrl", None), intermediate_results_url=escrow.get("intermediateResultsUrl", None), manifest_hash=escrow.get("manifestHash", None), - manifest_url=escrow.get("manifestUrl", None), + manifest=escrow.get("manifest", None), recording_oracle=escrow.get("recordingOracle", None), reputation_oracle=escrow.get("reputationOracle", None), exchange_oracle=escrow.get("exchangeOracle", None), @@ -335,7 +335,7 @@ def get_escrow( final_results_url=escrow.get("finalResultsUrl", None), intermediate_results_url=escrow.get("intermediateResultsUrl", None), manifest_hash=escrow.get("manifestHash", None), - manifest_url=escrow.get("manifestUrl", None), + manifest=escrow.get("manifest", None), recording_oracle=escrow.get("recordingOracle", None), reputation_oracle=escrow.get("reputationOracle", None), exchange_oracle=escrow.get("exchangeOracle", None), diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py index 137cfee5a9..5fdff656d8 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py @@ -14,7 +14,7 @@ launcher jobRequesterId manifestHash - manifestUrl + manifest recordingOracle reputationOracle exchangeOracle diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/utils.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/utils.py index a099270afd..34b52f78ed 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/utils.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/utils.py @@ -307,3 +307,15 @@ def validate_url(url: str) -> bool: return URL(url) return True + + +def validate_json(data: str) -> bool: + """Validates if the given string is a valid JSON. + :param data: String to validate + :return: True if the string is a valid JSON, False otherwise + """ + try: + json.loads(data) + return True + except (ValueError, TypeError): + return False diff --git a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py index 4fce80e892..6ef6e43ebe 100644 --- a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py @@ -75,7 +75,7 @@ def test_escrow_config_valid_params(self): recording_oracle_fee = 10 reputation_oracle_fee = 10 exchange_oracle_fee = 10 - manifest_url = "https://www.example.com/result" + manifest = "https://www.example.com/result" hash = "test" escrow_config = EscrowConfig( @@ -85,7 +85,7 @@ def test_escrow_config_valid_params(self): recording_oracle_fee, reputation_oracle_fee, exchange_oracle_fee, - manifest_url, + manifest, hash, ) @@ -99,9 +99,31 @@ def test_escrow_config_valid_params(self): self.assertEqual(escrow_config.recording_oracle_fee, recording_oracle_fee) self.assertEqual(escrow_config.reputation_oracle_fee, reputation_oracle_fee) self.assertEqual(escrow_config.exchange_oracle_fee, exchange_oracle_fee) - self.assertEqual(escrow_config.manifest_url, manifest_url) + self.assertEqual(escrow_config.manifest, manifest) self.assertEqual(escrow_config.hash, hash) + def test_escrow_config_valid_params_with_json_manifest(self): + recording_oracle_address = "0x1234567890123456789012345678901234567890" + reputation_oracle_address = "0x1234567890123456789012345678901234567890" + exchange_oracle_address = "0x1234567890123456789012345678901234567890" + recording_oracle_fee = 10 + reputation_oracle_fee = 10 + exchange_oracle_fee = 10 + manifest = '{"foo": "bar"}' + hash = "test" + + escrow_config = EscrowConfig( + recording_oracle_address, + reputation_oracle_address, + exchange_oracle_address, + recording_oracle_fee, + reputation_oracle_fee, + exchange_oracle_fee, + manifest, + hash, + ) + self.assertEqual(escrow_config.manifest, manifest) + def test_escrow_config_valid_params_with_docker_network_url(self): recording_oracle_address = "0x1234567890123456789012345678901234567890" reputation_oracle_address = "0x1234567890123456789012345678901234567890" @@ -109,7 +131,7 @@ def test_escrow_config_valid_params_with_docker_network_url(self): recording_oracle_fee = 10 reputation_oracle_fee = 10 exchange_oracle_fee = 10 - manifest_url = "http://test:6000" + manifest = "http://test:6000" hash = "test" escrow_config = EscrowConfig( @@ -119,7 +141,7 @@ def test_escrow_config_valid_params_with_docker_network_url(self): recording_oracle_fee, reputation_oracle_fee, exchange_oracle_fee, - manifest_url, + manifest, hash, ) @@ -133,7 +155,7 @@ def test_escrow_config_valid_params_with_docker_network_url(self): self.assertEqual(escrow_config.recording_oracle_fee, recording_oracle_fee) self.assertEqual(escrow_config.reputation_oracle_fee, reputation_oracle_fee) self.assertEqual(escrow_config.exchange_oracle_fee, exchange_oracle_fee) - self.assertEqual(escrow_config.manifest_url, manifest_url) + self.assertEqual(escrow_config.manifest, manifest) self.assertEqual(escrow_config.hash, hash) def test_escrow_config_invalid_address(self): @@ -289,14 +311,14 @@ def test_escrow_config_invalid_fee(self): ) self.assertEqual("Total fee must be less than 100", str(cm.exception)) - def test_escrow_config_invalid_url(self): + def test_escrow_config_invalid_manifest(self): recording_oracle_address = "0x1234567890123456789012345678901234567890" reputation_oracle_address = "0x1234567890123456789012345678901234567890" exchange_oracle_address = "0x1234567890123456789012345678901234567890" recording_oracle_fee = 10 reputation_oracle_fee = 10 exchange_oracle_fee = 10 - manifest_url = "test" + manifest = "" hash = "test" with self.assertRaises(EscrowClientError) as cm: @@ -307,10 +329,10 @@ def test_escrow_config_invalid_url(self): recording_oracle_fee, reputation_oracle_fee, exchange_oracle_fee, - manifest_url, + manifest, hash, ) - self.assertEqual(f"Invalid manifest URL: {manifest_url}", str(cm.exception)) + self.assertEqual("Invalid empty manifest", str(cm.exception)) def test_escrow_config_invalid_hash(self): recording_oracle_address = "0x1234567890123456789012345678901234567890" @@ -478,7 +500,7 @@ def test_setup(self): escrow_config.reputation_oracle_fee, escrow_config.recording_oracle_fee, escrow_config.exchange_oracle_fee, - escrow_config.manifest_url, + escrow_config.manifest, escrow_config.hash, ) mock_setup.transact.assert_called_once_with({}) @@ -503,6 +525,32 @@ def test_setup_invalid_address(self): self.escrow.setup(escrow_address, escrow_config) self.assertEqual(f"Invalid escrow address: {escrow_address}", str(cm.exception)) + def test_get_manifest(self): + escrow_address = "0x1234567890123456789012345678901234567890" + manifest = '{"foo": "bar"}' + mock_contract = MagicMock() + mock_contract.functions.manifest.return_value.call.return_value = manifest + self.escrow._get_escrow_contract = MagicMock(return_value=mock_contract) + result = self.escrow.get_manifest(escrow_address) + self.escrow._get_escrow_contract.assert_called_once_with(escrow_address) + mock_contract.functions.manifest.assert_called_once_with() + mock_contract.functions.manifest.return_value.call.assert_called_once_with() + self.assertEqual(result, manifest) + + escrow_config = EscrowConfig( + "0x1234567890123456789012345678901234567890", + "0x1234567890123456789012345678901234567890", + "0x1234567890123456789012345678901234567890", + 10, + 10, + 10, + "https://www.example.com/result", + "test", + ) + with self.assertRaises(EscrowClientError) as cm: + self.escrow.setup(escrow_address, escrow_config) + self.assertEqual(f"Invalid escrow address: {escrow_address}", str(cm.exception)) + def test_setup_without_account(self): mock_provider = MagicMock(spec=HTTPProvider) w3 = Web3(mock_provider) @@ -609,7 +657,7 @@ def test_setup_with_tx_options(self): escrow_config.reputation_oracle_fee, escrow_config.recording_oracle_fee, escrow_config.exchange_oracle_fee, - escrow_config.manifest_url, + escrow_config.manifest, escrow_config.hash, ) mock_setup.transact.assert_called_once_with(tx_options) @@ -1871,7 +1919,7 @@ def test_get_manifest_hash_invalid_address(self): self.escrow.get_manifest_hash("invalid_address") self.assertEqual(f"Invalid escrow address: invalid_address", str(cm.exception)) - def test_get_manifest_url(self): + def test_get_manifest(self): mock_contract = MagicMock() mock_contract.functions.manifestUrl = MagicMock() mock_contract.functions.manifestUrl.return_value.call.return_value = ( @@ -1880,18 +1928,18 @@ def test_get_manifest_url(self): self.escrow._get_escrow_contract = MagicMock(return_value=mock_contract) escrow_address = "0x1234567890123456789012345678901234567890" - result = self.escrow.get_manifest_url(escrow_address) + result = self.escrow.get_manifest(escrow_address) self.escrow._get_escrow_contract.assert_called_once_with(escrow_address) mock_contract.functions.manifestUrl.assert_called_once_with() self.assertEqual(result, "mock_value") - def test_get_manifest_url_invalid_address(self): + def test_get_manifest_invalid_address(self): with self.assertRaises(EscrowClientError) as cm: - self.escrow.get_manifest_url("invalid_address") + self.escrow.get_manifest("invalid_address") self.assertEqual(f"Invalid escrow address: invalid_address", str(cm.exception)) - def test_get_manifest_url_without_account(self): + def test_get_manifest_without_account(self): mock_provider = MagicMock(spec=HTTPProvider) w3 = Web3(mock_provider) mock_chain_id = ChainId.LOCALHOST.value @@ -1906,16 +1954,16 @@ def test_get_manifest_url_without_account(self): escrowClient._get_escrow_contract = MagicMock(return_value=mock_contract) escrow_address = "0x1234567890123456789012345678901234567890" - result = escrowClient.get_manifest_url(escrow_address) + result = escrowClient.get_manifest(escrow_address) escrowClient._get_escrow_contract.assert_called_once_with(escrow_address) mock_contract.functions.manifestUrl.assert_called_once_with() self.assertEqual(result, "mock_value") - def test_get_manifest_url_invalid_escrow(self): + def test_get_manifest_invalid_escrow(self): self.escrow.factory_contract.functions.hasEscrow = MagicMock(return_value=False) with self.assertRaises(EscrowClientError) as cm: - self.escrow.get_manifest_url("0x1234567890123456789012345678901234567890") + self.escrow.get_manifest("0x1234567890123456789012345678901234567890") self.assertEqual( "Escrow address is not provided by the factory", str(cm.exception) ) diff --git a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py index 028728c773..5dc910a526 100644 --- a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py +++ b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py @@ -35,7 +35,7 @@ def test_get_escrows(self): "intermediateResultsUrl": "https://example.com", "launcher": "0x1234567890123456789012345678901234567891", "manifestHash": "0x1234567890123456789012345678901234567891", - "manifestUrl": "https://example.com", + "manifest": "https://example.com", "recordingOracle": "0x1234567890123456789012345678901234567891", "reputationOracle": "0x1234567890123456789012345678901234567891", "exchangeOracle": "0x1234567890123456789012345678901234567891", @@ -196,7 +196,7 @@ def test_get_escrow(self): "intermediateResultsUrl": "https://example.com", "launcher": "0x1234567890123456789012345678901234567891", "manifestHash": "0x1234567890123456789012345678901234567891", - "manifestUrl": "https://example.com", + "manifest": "https://example.com", "recordingOracle": "0x1234567890123456789012345678901234567891", "reputationOracle": "0x1234567890123456789012345678901234567891", "exchangeOracle": "0x1234567890123456789012345678901234567891", diff --git a/packages/sdk/typescript/human-protocol-sdk/src/constants.ts b/packages/sdk/typescript/human-protocol-sdk/src/constants.ts index 1ee3cab49c..fb59fc4b06 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/constants.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/constants.ts @@ -36,7 +36,7 @@ export const NETWORKS: { subgraphUrl: 'https://api.studio.thegraph.com/query/74256/ethereum/version/latest', subgraphUrlApiKey: - 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmSxVvFd4STZkR9gwfuJ76YUpYGcWcBJ6Sm3kqBJHFdUw2', + 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmQwp4Rr2J4UbPFykb9eXg2t7GPcGRS6WT7QzExZtv32jK', oldSubgraphUrl: '', oldFactoryAddress: '', }, @@ -51,7 +51,7 @@ export const NETWORKS: { subgraphUrl: 'https://api.studio.thegraph.com/query/74256/sepolia/version/latest', subgraphUrlApiKey: - 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmP3Ma4hZ6ZBxNTL2ip2BCkB33vMgRKRLpw74KcwZShzvk', + 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmURrhnEXimGnRzjeN3B4VMmioUeBHUBg4WJ7KZzJ7em8g', oldSubgraphUrl: '', oldFactoryAddress: '', }, @@ -66,7 +66,7 @@ export const NETWORKS: { subgraphUrl: 'https://api.studio.thegraph.com/query/74256/bsc/version/latest', subgraphUrlApiKey: - 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmW54Mzx63QNVdvk2V9kRaoHicfeJFuDSt7xSGDHpZg9AW', + 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmT2VoBLjAfc4pQzDmeCGra6weoLuk2jPRgnRz5iSMUw1t', oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsc', oldFactoryAddress: '0xc88bC422cAAb2ac8812de03176402dbcA09533f4', }, @@ -81,7 +81,7 @@ export const NETWORKS: { subgraphUrl: 'https://api.studio.thegraph.com/query/74256/bsc-testnet/version/latest', subgraphUrlApiKey: - 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWaq9orii1Xkw9uCVJ7akDnjY2fuewBRU5LiUKT12XVui', + 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmZHqbiyAAwrmqsVJLhTEdejVGYJpXfJAkJXUw7C2VV1TD', oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsctest', oldFactoryAddress: '0xaae6a2646c1f88763e62e0cd08ad050ea66ac46f', @@ -97,7 +97,7 @@ export const NETWORKS: { subgraphUrl: 'https://api.studio.thegraph.com/query/74256/polygon/version/latest', subgraphUrlApiKey: - 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmVmsQCdB3dGjt9tKG2Y96PRsHUCgGPK8oWtyVw8HMypTc', + 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmT72ecfx6Zaje21kLNi17kDJTpPKFYvzQETDyLpQgDrPu', oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/polygon', oldFactoryAddress: '0x45eBc3eAE6DA485097054ae10BA1A0f8e8c7f794', @@ -113,7 +113,7 @@ export const NETWORKS: { subgraphUrl: 'https://api.studio.thegraph.com/query/74256/amoy/version/latest', subgraphUrlApiKey: - 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmPD243cnyp6ApUT2zpsNLKmtM75RLHNwUGT7NRTDds7QN', + 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmeeE9bVkat1mkbQg1R6SXLuLadXxoNCY5b7CEQkmu6cQi', oldSubgraphUrl: '', oldFactoryAddress: '', }, @@ -128,7 +128,7 @@ export const NETWORKS: { subgraphUrl: 'https://api.studio.thegraph.com/query/74256/amoy/version/latest', subgraphUrlApiKey: - 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmVQuank2mwaZg3mcLUH15QEP8KaVS4NNsRaWxnq5mRWoo', + 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmQiLaFKusXLzKrpZvQDg7vETLhdfPgzWJN3Uxp3bE9K9W', oldSubgraphUrl: '', oldFactoryAddress: '', }, diff --git a/packages/sdk/typescript/human-protocol-sdk/src/error.ts b/packages/sdk/typescript/human-protocol-sdk/src/error.ts index c39c75d714..729239ee8f 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/error.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/error.ts @@ -202,9 +202,9 @@ export const ErrorManifestFileDoesNotExist = new Error( export const ErrorInvalidUrl = new Error('Invalid URL string'); /** - * @constant {Error} - URL is an empty string. + * @constant {Error} - Invalid manifest. */ -export const ErrorUrlIsEmptyString = new Error('URL is an empty string'); +export const ErrorInvalidManifest = new Error('Invalid manifest'); /** * @constant {Error} - List of handlers cannot be empty. diff --git a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts index 911337964b..709a2f42be 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts @@ -24,6 +24,7 @@ import { ErrorInvalidAddress, ErrorInvalidEscrowAddressProvided, ErrorInvalidExchangeOracleAddressProvided, + ErrorInvalidManifest, ErrorInvalidRecordingOracleAddressProvided, ErrorInvalidReputationOracleAddressProvided, ErrorInvalidTokenAddress, @@ -37,7 +38,6 @@ import { ErrorTotalFeeMustBeLessThanHundred, ErrorTransferEventNotFoundInTransactionLogs, ErrorUnsupportedChainID, - ErrorUrlIsEmptyString, InvalidEthereumAddressError, } from './error'; import { @@ -66,6 +66,7 @@ import { import { getSubgraphUrl, getUnixTimestamp, + isValidJson, isValidUrl, throwError, } from './utils'; @@ -302,7 +303,7 @@ export class EscrowClient extends BaseEthersClient { * recordingOracleFee: BigInt('10'), * reputationOracleFee: BigInt('10'), * exchangeOracleFee: BigInt('10'), - * manifestUrl: 'http://localhost/manifest.json', + * manifest: 'http://localhost/manifest.json', * manifestHash: 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079', * }; * await escrowClient.setup(escrowAddress, escrowConfig); @@ -321,7 +322,7 @@ export class EscrowClient extends BaseEthersClient { recordingOracleFee, reputationOracleFee, exchangeOracleFee, - manifestUrl, + manifest, manifestHash, } = escrowConfig; @@ -353,12 +354,9 @@ export class EscrowClient extends BaseEthersClient { throw ErrorTotalFeeMustBeLessThanHundred; } - if (!manifestUrl) { - throw ErrorUrlIsEmptyString; - } - - if (!isValidUrl(manifestUrl)) { - throw ErrorInvalidUrl; + const isManifestValid = isValidUrl(manifest) || isValidJson(manifest); + if (!isManifestValid) { + throw ErrorInvalidManifest; } if (!manifestHash) { @@ -380,7 +378,7 @@ export class EscrowClient extends BaseEthersClient { reputationOracleFee, recordingOracleFee, exchangeOracleFee, - manifestUrl, + manifest, manifestHash, txOptions ) @@ -495,7 +493,7 @@ export class EscrowClient extends BaseEthersClient { } if (!url) { - throw ErrorUrlIsEmptyString; + throw ErrorInvalidUrl; } if (!isValidUrl(url)) { @@ -1043,7 +1041,7 @@ export class EscrowClient extends BaseEthersClient { }); if (!finalResultsUrl) { - throw ErrorUrlIsEmptyString; + throw ErrorInvalidUrl; } if (!isValidUrl(finalResultsUrl)) { @@ -1153,7 +1151,7 @@ export class EscrowClient extends BaseEthersClient { } /** - * This function returns the manifest file URL. + * This function returns the manifest. Could be a URL or a JSON string. * * @param {string} escrowAddress Address of the escrow. * @returns {Promise} Url of the manifest. @@ -1169,10 +1167,10 @@ export class EscrowClient extends BaseEthersClient { * const provider = new providers.JsonRpcProvider(rpcUrl); * const escrowClient = await EscrowClient.build(provider); * - * const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); + * const manifest = await escrowClient.getManifest('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); * ``` */ - async getManifestUrl(escrowAddress: string): Promise { + async getManifest(escrowAddress: string): Promise { if (!ethers.isAddress(escrowAddress)) { throw ErrorInvalidEscrowAddressProvided; } @@ -1631,7 +1629,7 @@ export class EscrowUtils { * intermediateResultsUrl?: string; * launcher: string; * manifestHash?: string; - * manifestUrl?: string; + * manifest?: string; * recordingOracle?: string; * reputationOracle?: string; * exchangeOracle?: string; @@ -1752,7 +1750,7 @@ export class EscrowUtils { * intermediateResultsUrl?: string; * launcher: string; * manifestHash?: string; - * manifestUrl?: string; + * manifest?: string; * recordingOracle?: string; * reputationOracle?: string; * exchangeOracle?: string; diff --git a/packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts b/packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts index 844c05bb14..accf8f7489 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts @@ -14,7 +14,7 @@ const ESCROW_FRAGMENT = gql` jobRequesterId launcher manifestHash - manifestUrl + manifest recordingOracle reputationOracle exchangeOracle diff --git a/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts b/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts index eb20a5b7b5..d70fa76c4a 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts @@ -75,7 +75,7 @@ export interface IEscrow { intermediateResultsUrl?: string; launcher: string; manifestHash?: string; - manifestUrl?: string; + manifest?: string; recordingOracle?: string; reputationOracle?: string; exchangeOracle?: string; @@ -105,7 +105,7 @@ export interface IEscrowConfig { recordingOracleFee: bigint; reputationOracleFee: bigint; exchangeOracleFee: bigint; - manifestUrl: string; + manifest: string; manifestHash: string; } diff --git a/packages/sdk/typescript/human-protocol-sdk/src/utils.ts b/packages/sdk/typescript/human-protocol-sdk/src/utils.ts index c687293e3c..acb9e67592 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/utils.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/utils.ts @@ -54,6 +54,21 @@ export const isValidUrl = (url: string) => { } }; +/** + * **Check if a string is a valid JSON.* + * + * @param {string} input + * @returns {boolean} + */ +export const isValidJson = (input: string): boolean => { + try { + JSON.parse(input); + return true; + } catch { + return false; + } +}; + /** * **Get the subgraph URL.* * diff --git a/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts b/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts index a0ae44fad1..053a185768 100644 --- a/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts +++ b/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts @@ -31,7 +31,7 @@ import { ErrorTooManyRecipients, ErrorTotalFeeMustBeLessThanHundred, ErrorUnsupportedChainID, - ErrorUrlIsEmptyString, + ErrorInvalidManifest, InvalidEthereumAddressError, } from '../src/error'; import { EscrowClient, EscrowUtils } from '../src/escrow'; @@ -308,7 +308,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: FAKE_HASH, }; @@ -325,7 +325,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: FAKE_HASH, }; @@ -342,7 +342,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: FAKE_HASH, }; @@ -359,7 +359,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: FAKE_HASH, }; @@ -376,7 +376,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, manifestHash: FAKE_HASH, }; @@ -395,7 +395,7 @@ describe('EscrowClient', () => { recordingOracleFee: 0n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: FAKE_HASH, }; @@ -414,7 +414,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 0n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: FAKE_HASH, }; @@ -433,7 +433,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 0n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: FAKE_HASH, }; @@ -452,7 +452,7 @@ describe('EscrowClient', () => { recordingOracleFee: 40n, reputationOracleFee: 40n, exchangeOracleFee: 40n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: FAKE_HASH, }; @@ -463,7 +463,7 @@ describe('EscrowClient', () => { ).rejects.toThrow(ErrorTotalFeeMustBeLessThanHundred); }); - test('should throw an error if manifestUrl is an empty string', async () => { + test('should throw an error if manifest is an empty string', async () => { const escrowConfig = { recordingOracle: ethers.ZeroAddress, reputationOracle: ethers.ZeroAddress, @@ -471,18 +471,18 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: '', - hash: FAKE_HASH, + manifest: '', + manifestHash: FAKE_HASH, }; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); await expect( escrowClient.setup(ethers.ZeroAddress, escrowConfig) - ).rejects.toThrow(ErrorUrlIsEmptyString); + ).rejects.toThrow(ErrorInvalidManifest); }); - test('should throw an error if manifestUrl is an invalid url', async () => { + test('should accept manifest as a JSON string', async () => { const escrowConfig = { recordingOracle: ethers.ZeroAddress, reputationOracle: ethers.ZeroAddress, @@ -490,15 +490,30 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: FAKE_URL, - hash: FAKE_HASH, + manifest: '{"foo":"bar"}', + manifestHash: FAKE_HASH, }; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); + const setupSpy = vi + .spyOn(escrowClient.escrowContract, 'setup') + .mockImplementation(() => ({ + wait: vi.fn().mockResolvedValue(true), + })); - await expect( - escrowClient.setup(ethers.ZeroAddress, escrowConfig) - ).rejects.toThrow(ErrorInvalidUrl); + await escrowClient.setup(ethers.ZeroAddress, escrowConfig); + + expect(setupSpy).toHaveBeenCalledWith( + ethers.ZeroAddress, + ethers.ZeroAddress, + ethers.ZeroAddress, + 10n, + 10n, + 10n, + '{"foo":"bar"}', + FAKE_HASH, + {} + ); }); test('should throw an error if hash is an empty string', async () => { @@ -509,7 +524,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, hash: '', }; @@ -528,7 +543,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, manifestHash: FAKE_HASH, }; @@ -562,7 +577,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, manifestHash: FAKE_HASH, }; @@ -594,7 +609,7 @@ describe('EscrowClient', () => { recordingOracleFee: 10n, reputationOracleFee: 10n, exchangeOracleFee: 10n, - manifestUrl: VALID_URL, + manifest: VALID_URL, manifestHash: FAKE_HASH, }; @@ -745,7 +760,7 @@ describe('EscrowClient', () => { await expect( escrowClient.storeResults(escrowAddress, url, hash) - ).rejects.toThrow(ErrorUrlIsEmptyString); + ).rejects.toThrow(ErrorInvalidUrl); }); test('should throw an error if results url is invalid url', async () => { @@ -1049,7 +1064,7 @@ describe('EscrowClient', () => { finalResultsUrl, finalResultsHash ) - ).rejects.toThrow(ErrorUrlIsEmptyString); + ).rejects.toThrow(ErrorInvalidUrl); }); test('should throw an error if final results url is an invalid url', async () => { @@ -1370,7 +1385,7 @@ describe('EscrowClient', () => { finalResultsUrl, finalResultsHash ) - ).rejects.toThrow(ErrorUrlIsEmptyString); + ).rejects.toThrow(ErrorInvalidUrl); }); test('should throw an error if final results url is an invalid url', async () => { @@ -2092,11 +2107,11 @@ describe('EscrowClient', () => { }); }); - describe('getManifestUrl', () => { + describe('getManifest', () => { test('should throw an error if escrowAddress is an invalid address', async () => { const escrowAddress = FAKE_ADDRESS; - await expect(escrowClient.getManifestUrl(escrowAddress)).rejects.toThrow( + await expect(escrowClient.getManifest(escrowAddress)).rejects.toThrow( ErrorInvalidEscrowAddressProvided ); }); @@ -2106,7 +2121,7 @@ describe('EscrowClient', () => { escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(false); - await expect(escrowClient.getManifestUrl(escrowAddress)).rejects.toThrow( + await expect(escrowClient.getManifest(escrowAddress)).rejects.toThrow( ErrorEscrowAddressIsNotProvidedByFactory ); }); @@ -2118,12 +2133,23 @@ describe('EscrowClient', () => { escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); escrowClient.escrowContract.manifestUrl.mockReturnValue(url); - const manifestUrl = await escrowClient.getManifestUrl(escrowAddress); + const manifestUrl = await escrowClient.getManifest(escrowAddress); expect(manifestUrl).toEqual(url); expect(escrowClient.escrowContract.manifestUrl).toHaveBeenCalledWith(); }); + test('should return the manifest string', async () => { + const escrowAddress = ethers.ZeroAddress; + const manifestString = '{"foo":"bar"}'; + escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); + escrowClient.escrowContract.manifestUrl = vi + .fn() + .mockReturnValue(manifestString); + const result = await escrowClient.getManifest(escrowAddress); + expect(result).toBe(manifestString); + }); + test('should throw an error if getManifestUrl fails', async () => { const escrowAddress = ethers.ZeroAddress; @@ -2132,9 +2158,7 @@ describe('EscrowClient', () => { new Error() ); - await expect( - escrowClient.getManifestUrl(escrowAddress) - ).rejects.toThrow(); + await expect(escrowClient.getManifest(escrowAddress)).rejects.toThrow(); expect(escrowClient.escrowContract.manifestUrl).toHaveBeenCalledWith(); }); diff --git a/packages/sdk/typescript/subgraph/schema.graphql b/packages/sdk/typescript/subgraph/schema.graphql index 1761efb2c4..cbe5b5b86a 100644 --- a/packages/sdk/typescript/subgraph/schema.graphql +++ b/packages/sdk/typescript/subgraph/schema.graphql @@ -81,7 +81,7 @@ type Escrow @entity { totalFundedAmount: BigInt! amountPaid: BigInt! status: String! # string - manifestUrl: String # string + manifest: String # string manifestHash: String # string reputationOracle: Bytes # address recordingOracle: Bytes # address diff --git a/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts b/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts index cbfaeeaf3c..d5ccea18b6 100644 --- a/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts +++ b/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts @@ -135,13 +135,13 @@ function createCommonEntitiesForPending( function updateEscrowEntityForPending( escrowEntity: Escrow, escrowStatusEvent: EscrowStatusEvent, - manifestUrl: string, + manifest: string, manifestHash: string, reputationOracle: Address | null = null, recordingOracle: Address | null = null, exchangeOracle: Address | null = null ): void { - escrowEntity.manifestUrl = manifestUrl; + escrowEntity.manifest = manifest; escrowEntity.manifestHash = manifestHash; escrowEntity.status = 'Pending'; diff --git a/packages/sdk/typescript/subgraph/src/mapping/legacy/Escrow.ts b/packages/sdk/typescript/subgraph/src/mapping/legacy/Escrow.ts index 570b5496ef..e1cafcc7bc 100644 --- a/packages/sdk/typescript/subgraph/src/mapping/legacy/Escrow.ts +++ b/packages/sdk/typescript/subgraph/src/mapping/legacy/Escrow.ts @@ -57,7 +57,7 @@ export function handlePending(event: Pending): void { // Update escrow entity const escrowEntity = Escrow.load(dataSource.address()); if (escrowEntity) { - escrowEntity.manifestUrl = event.params.manifest; + escrowEntity.manifest = event.params.manifest; escrowEntity.manifestHash = event.params.hash; escrowEntity.status = 'Pending'; diff --git a/packages/sdk/typescript/subgraph/tests/escrow/escrow.test.ts b/packages/sdk/typescript/subgraph/tests/escrow/escrow.test.ts index 22e01f2143..100c7cbcda 100644 --- a/packages/sdk/typescript/subgraph/tests/escrow/escrow.test.ts +++ b/packages/sdk/typescript/subgraph/tests/escrow/escrow.test.ts @@ -195,7 +195,7 @@ describe('Escrow', () => { // Escrow assert.fieldEquals('Escrow', escrowAddress.toHex(), 'status', 'Pending'); - assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestUrl', URL); + assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifest', URL); assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestHash', HASH); assert.fieldEquals( 'Escrow', @@ -325,7 +325,7 @@ describe('Escrow', () => { // Escrow assert.fieldEquals('Escrow', escrowAddress.toHex(), 'status', 'Pending'); - assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestUrl', URL); + assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifest', URL); assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestHash', HASH); assert.fieldEquals( 'Escrow', @@ -472,7 +472,7 @@ describe('Escrow', () => { // Escrow assert.fieldEquals('Escrow', escrowAddress.toHex(), 'status', 'Pending'); - assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestUrl', URL); + assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifest', URL); assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestHash', HASH); assert.fieldEquals( 'Escrow', @@ -681,7 +681,7 @@ describe('Escrow', () => { // Escrow assert.fieldEquals('Escrow', escrowAddress.toHex(), 'status', 'Pending'); - assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestUrl', URL); + assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifest', URL); assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestHash', HASH); assert.fieldEquals( 'Escrow', diff --git a/packages/sdk/typescript/subgraph/tests/legacy/escrow/escrow.test.ts b/packages/sdk/typescript/subgraph/tests/legacy/escrow/escrow.test.ts index 43fb67e5a8..a7e7b37a2e 100644 --- a/packages/sdk/typescript/subgraph/tests/legacy/escrow/escrow.test.ts +++ b/packages/sdk/typescript/subgraph/tests/legacy/escrow/escrow.test.ts @@ -143,7 +143,7 @@ describe('Escrow', () => { // Escrow assert.fieldEquals('Escrow', escrowAddress.toHex(), 'status', 'Pending'); - assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestUrl', URL); + assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifest', URL); assert.fieldEquals('Escrow', escrowAddress.toHex(), 'manifestHash', HASH); assert.fieldEquals( 'Escrow',