Skip to content

Commit c6b9299

Browse files
committed
Removed Audino-related code
1 parent dddf2b8 commit c6b9299

35 files changed

Lines changed: 22 additions & 1560 deletions

packages/apps/job-launcher/client/src/components/Jobs/Create/AudinoJobRequestForm.tsx

Lines changed: 0 additions & 671 deletions
This file was deleted.

packages/apps/job-launcher/client/src/components/Jobs/Create/CreateJob.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { NetworkSelect } from '../../../components/NetworkSelect';
66
import { IS_MAINNET } from '../../../constants/chains';
77
import { useCreateJobPageUI } from '../../../providers/CreateJobPageUIProvider';
88
import { JobType, PayMethod } from '../../../types';
9-
import { AudinoJobRequestForm } from './AudinoJobRequestForm';
109
import { CvatJobRequestForm } from './CvatJobRequestForm';
1110
import { FortuneJobRequestForm } from './FortuneJobRequestForm';
1211
import { HCaptchaJobRequestForm } from './HCaptchaJobRequestForm';
@@ -66,10 +65,6 @@ export const CreateJob = () => {
6665
<MenuItem value={JobType.FORTUNE}>Fortune</MenuItem>
6766
)}
6867
{!IS_MAINNET && <MenuItem value={JobType.CVAT}>CVAT</MenuItem>}
69-
{/* {!IS_MAINNET && (
70-
<MenuItem value={JobType.HCAPTCHA}>hCaptcha</MenuItem>
71-
)} */}
72-
<MenuItem value={JobType.AUDINO}>Audino</MenuItem>
7368
</Select>
7469
</FormControl>
7570
<NetworkSelect
@@ -86,7 +81,6 @@ export const CreateJob = () => {
8681
{jobRequest.jobType === JobType.FORTUNE && <FortuneJobRequestForm />}
8782
{jobRequest.jobType === JobType.CVAT && <CvatJobRequestForm />}
8883
{jobRequest.jobType === JobType.HCAPTCHA && <HCaptchaJobRequestForm />}
89-
{jobRequest.jobType === JobType.AUDINO && <AudinoJobRequestForm />}
9084
</Box>
9185
);
9286
};

packages/apps/job-launcher/client/src/components/Jobs/Create/CryptoPayForm.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ export const CryptoPayForm = ({
224224
fortuneRequest,
225225
cvatRequest,
226226
hCaptchaRequest,
227-
audinoRequest,
228227
} = jobRequest;
229228
if (jobType === JobType.FORTUNE && fortuneRequest) {
230229
await jobService.createFortuneJob(
@@ -244,14 +243,6 @@ export const CryptoPayForm = ({
244243
);
245244
} else if (jobType === JobType.HCAPTCHA && hCaptchaRequest) {
246245
await jobService.createHCaptchaJob(chainId, hCaptchaRequest);
247-
} else if (jobType === JobType.AUDINO && audinoRequest) {
248-
await jobService.createAudinoJob(
249-
chainId,
250-
audinoRequest,
251-
paymentTokenSymbol,
252-
Number(amount),
253-
fundTokenSymbol,
254-
);
255246
}
256247
onFinish();
257248
} catch (err) {

packages/apps/job-launcher/client/src/components/Jobs/Create/FiatPayForm.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { CURRENCY } from '../../../constants/payment';
2929
import { useCreateJobPageUI } from '../../../providers/CreateJobPageUIProvider';
3030
import { useSnackbar } from '../../../providers/SnackProvider';
3131
import {
32-
createAudinoJob,
3332
createCvatJob,
3433
createFortuneJob,
3534
createHCaptchaJob,
@@ -248,14 +247,8 @@ export const FiatPayForm = ({
248247
}
249248

250249
// create job
251-
const {
252-
jobType,
253-
chainId,
254-
fortuneRequest,
255-
cvatRequest,
256-
hCaptchaRequest,
257-
audinoRequest,
258-
} = jobRequest;
250+
const { jobType, chainId, fortuneRequest, cvatRequest, hCaptchaRequest } =
251+
jobRequest;
259252
if (!chainId) return;
260253

261254
if (jobType === JobType.FORTUNE && fortuneRequest) {
@@ -276,14 +269,6 @@ export const FiatPayForm = ({
276269
);
277270
} else if (jobType === JobType.HCAPTCHA && hCaptchaRequest) {
278271
await createHCaptchaJob(chainId, hCaptchaRequest);
279-
} else if (jobType === JobType.AUDINO && audinoRequest) {
280-
await createAudinoJob(
281-
chainId,
282-
audinoRequest,
283-
CURRENCY.usd,
284-
amount,
285-
tokenSymbol,
286-
);
287272
}
288273

289274
// Update balance and finish payment

packages/apps/job-launcher/client/src/components/Jobs/Create/helpers.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,3 @@ export const mapFortuneFormValues = (
6767
: [],
6868
};
6969
};
70-
71-
export const mapAudinoFormValues = (
72-
jobRequest: JobRequest,
73-
qualificationsOptions: Qualification[],
74-
) => {
75-
const { audinoRequest } = jobRequest;
76-
77-
return {
78-
type: audinoRequest?.type,
79-
labels: audinoRequest?.labels?.map((label) => label.name) || [],
80-
description: audinoRequest?.description || '',
81-
qualifications: audinoRequest?.qualifications
82-
? qualificationsOptions.filter((q: Qualification) =>
83-
audinoRequest?.qualifications?.includes(q.reference),
84-
)
85-
: [],
86-
87-
dataProvider:
88-
audinoRequest?.data?.dataset?.provider || StorageProviders.AWS,
89-
dataRegion:
90-
(audinoRequest?.data?.dataset?.region as AWSRegions | GCSRegions) || '',
91-
dataBucketName: audinoRequest?.data?.dataset?.bucketName || '',
92-
dataPath: audinoRequest?.data?.dataset?.path || '',
93-
94-
gtProvider: audinoRequest?.groundTruth?.provider || StorageProviders.AWS,
95-
gtRegion:
96-
(audinoRequest?.groundTruth?.region as AWSRegions | GCSRegions) || '',
97-
gtBucketName: audinoRequest?.groundTruth?.bucketName || '',
98-
gtPath: audinoRequest?.groundTruth?.path || '',
99-
100-
userGuide: audinoRequest?.userGuide || '',
101-
accuracyTarget: audinoRequest?.accuracyTarget || 50,
102-
103-
segmentDuration: audinoRequest?.segmentDuration || 0,
104-
};
105-
};

packages/apps/job-launcher/client/src/components/Jobs/Create/schema.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -89,28 +89,3 @@ export const HCaptchaJobRequesteValidationSchema = Yup.object().shape({
8989
images: Yup.array().of(Yup.string().url('Invalid Image URL')),
9090
qualifications: Yup.array().of(Yup.object()),
9191
});
92-
93-
export const AudinoJobRequestValidationSchema = Yup.object().shape({
94-
labels: Yup.array().of(Yup.string()).min(1, 'At least one label is required'),
95-
description: Yup.string().required('Description is required'),
96-
dataProvider: Yup.string().required('Provider is required'),
97-
dataRegion: Yup.string().required('Region is required'),
98-
dataBucketName: Yup.string().required('Bucket name is required'),
99-
dataPath: Yup.string().optional(),
100-
gtProvider: Yup.string().required('Provider is required'),
101-
gtRegion: Yup.string().required('Region is required'),
102-
gtBucketName: Yup.string().required('Bucket name is required'),
103-
gtPath: Yup.string().optional(),
104-
userGuide: Yup.string()
105-
.required('User Guide URL is required')
106-
.url('Invalid URL'),
107-
accuracyTarget: Yup.number()
108-
.required('Accuracy target is required')
109-
.moreThan(0, 'Accuracy target must be greater than 0')
110-
.max(100, 'Accuracy target must be less than or equal to 100'),
111-
qualifications: Yup.array().of(Yup.object()),
112-
segmentDuration: Yup.number()
113-
.required('Segment duration is required')
114-
.moreThan(0, 'Segment duration must be greater than 0')
115-
.max(3600000, 'Segment duration must be less than or equal to 3600000'), // one hour in ms
116-
});

packages/apps/job-launcher/client/src/services/job.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88
JobDetailsResponse,
99
HCaptchaRequest,
1010
FortuneFinalResult,
11-
AudinoRequest,
12-
CreateAudinoJobRequest,
1311
} from '../types';
1412
import api from '../utils/api';
1513
import { getFilenameFromContentDisposition } from '../utils/string';
@@ -68,32 +66,6 @@ export const createHCaptchaJob = async (
6866
});
6967
};
7068

71-
export const createAudinoJob = async (
72-
chainId: number,
73-
data: AudinoRequest,
74-
paymentCurrency: string,
75-
paymentAmount: number | string,
76-
escrowFundToken: string,
77-
) => {
78-
const body: CreateAudinoJobRequest = {
79-
chainId,
80-
requesterDescription: data.description,
81-
paymentCurrency,
82-
paymentAmount: Number(paymentAmount),
83-
escrowFundToken,
84-
data: data.data,
85-
labels: data.labels,
86-
minQuality: Number(data.accuracyTarget) / 100,
87-
groundTruth: data.groundTruth,
88-
userGuide: data.userGuide,
89-
type: data.type,
90-
qualifications: data.qualifications,
91-
segmentDuration: Number(data.segmentDuration),
92-
};
93-
94-
await api.post('/job/audino', body);
95-
};
96-
9769
export const getJobList = async ({
9870
chainId = ChainId.ALL,
9971
status,

packages/apps/job-launcher/client/src/types/index.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,6 @@ export type CreateCvatJobRequest = {
6565
type: CvatJobType;
6666
};
6767

68-
export type CreateAudinoJobRequest = {
69-
chainId: number;
70-
requesterDescription: string;
71-
qualifications?: string[];
72-
paymentCurrency: string;
73-
paymentAmount: number;
74-
escrowFundToken: string;
75-
data: AudinoData;
76-
labels: Array<{ name: string }>;
77-
minQuality: number;
78-
groundTruth: AudinoDataSource;
79-
userGuide: string;
80-
type: AudinoJobType;
81-
segmentDuration: number;
82-
};
83-
8468
export enum CreateJobStep {
8569
FundingMethod,
8670
CreateJob,
@@ -104,7 +88,6 @@ export enum JobType {
10488
FORTUNE = 'fortune',
10589
CVAT = 'cvat',
10690
HCAPTCHA = 'hcaptcha',
107-
AUDINO = 'audino',
10891
}
10992

11093
export enum CvatJobType {
@@ -123,11 +106,6 @@ export enum HCaptchaJobType {
123106
COMPARISON = 'comparison',
124107
}
125108

126-
export enum AudinoJobType {
127-
AUDIO_TRANSCRIPTION = 'audio_transcription',
128-
AUDIO_ATTRIBUTE_ANNOTATION = 'audio_attribute_annotation',
129-
}
130-
131109
export type FortuneRequest = {
132110
title: string;
133111
fortunesRequested: number;
@@ -269,36 +247,12 @@ export type HCaptchaRequest = {
269247
};
270248
};
271249

272-
type AudinoDataSource = {
273-
provider: StorageProviders;
274-
region: AWSRegions | GCSRegions;
275-
bucketName: string;
276-
path: string;
277-
};
278-
279-
type AudinoData = {
280-
dataset: AudinoDataSource;
281-
};
282-
283-
export type AudinoRequest = {
284-
labels: Array<{ name: string }>;
285-
type: AudinoJobType;
286-
description: string;
287-
qualifications?: string[];
288-
data: AudinoData;
289-
groundTruth: AudinoDataSource;
290-
userGuide: string;
291-
accuracyTarget: number;
292-
segmentDuration: number;
293-
};
294-
295250
export type JobRequest = {
296251
jobType: JobType;
297252
chainId?: ChainId;
298253
fortuneRequest?: FortuneRequest;
299254
cvatRequest?: CvatRequest;
300255
hCaptchaRequest?: HCaptchaRequest;
301-
audinoRequest?: AudinoRequest;
302256
};
303257

304258
export enum JobStatus {

packages/apps/job-launcher/server/src/common/config/env-schema.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ export const envValidator = Joi.object({
3232
REPUTATION_ORACLES: Joi.string().required(),
3333
CVAT_EXCHANGE_ORACLE_ADDRESS: Joi.string().required(),
3434
CVAT_RECORDING_ORACLE_ADDRESS: Joi.string().required(),
35-
AUDINO_EXCHANGE_ORACLE_ADDRESS: Joi.string(),
36-
AUDINO_RECORDING_ORACLE_ADDRESS: Joi.string(),
3735
HCAPTCHA_ORACLE_ADDRESS: Joi.string().required(),
3836
HCAPTCHA_RECORDING_ORACLE_URI: Joi.string().required(),
3937
HCAPTCHA_REPUTATION_ORACLE_URI: Joi.string().required(),

packages/apps/job-launcher/server/src/common/config/web3-config.service.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,6 @@ export class Web3ConfigService {
9393
return this.configService.getOrThrow<string>('HCAPTCHA_ORACLE_ADDRESS');
9494
}
9595

96-
/**
97-
* Address of the Audino exchange oracle.
98-
*/
99-
get audinoExchangeOracleAddress(): string {
100-
return this.configService.getOrThrow<string>(
101-
'AUDINO_EXCHANGE_ORACLE_ADDRESS',
102-
);
103-
}
104-
105-
/**
106-
* Address of the Audino recording oracle.
107-
*/
108-
get audinoRecordingOracleAddress(): string {
109-
return this.configService.getOrThrow<string>(
110-
'AUDINO_RECORDING_ORACLE_ADDRESS',
111-
);
112-
}
113-
11496
get approveAmountUsd(): number {
11597
return this.configService.get<number>('APPROVE_AMOUNT_USD', 0);
11698
}

0 commit comments

Comments
 (0)