From c0c76c99a93daefb1c985f66f5cdb2e175654a31 Mon Sep 17 00:00:00 2001 From: Jeffrieh Date: Fri, 19 Jul 2024 10:00:30 +0000 Subject: [PATCH] chore: format --- package.json | 76 ++++++------- src/@generated/types/tasks.efx.ts | 161 ++++++++++++++++++++++----- src/@generated/types/vaccount.efx.ts | 41 +++++-- src/actions/tasks/getTask.ts | 2 - 4 files changed, 205 insertions(+), 75 deletions(-) diff --git a/package.json b/package.json index 5423cb64..c083fed4 100644 --- a/package.json +++ b/package.json @@ -1,40 +1,40 @@ { - "name": "@effectai/sdk", - "workspaces": ["docs", "src"], - "scripts": { - "test": "bun --env-file=.env test", - "test:watch": "bun --env-file=.env test --watch", - "test:only": "bun --env-file=.env test --watch --only", - "test:coverage": "bun --env-file=.env test --coverage", - "dev": "tsc -w --project src/tsconfig.build.json", - "build": "bun run sdk:build && bun run docs:build", - "lint": "biome lint --apply .", - "format": "biome format --write .", - "check": "biome check --apply .", - "changeset": "changeset", - "changeset:public": "bun scripts/updateVersion.ts && bun run build && changeset publish", - "changeset:version": "changeset version && bun install --frozen-lockfile && bun scripts/updateVersion.ts", - "changeset:publish": "bun run build && changeset publish", - "docs:dev": "cd docs && bun run dev", - "docs:build": "cd docs && bun run build", - "docs:preview": "cd docs && bun run preview", - "sdk:build": "tsc --project src/tsconfig.build.json --module es2020", - "link": "cd src && bun link" - }, - "devDependencies": { - "@biomejs/biome": "1.7.0", - "@wharfkit/wallet-plugin-privatekey": "^1.0.0", - "@changesets/changelog-github": "^0.4.5", - "@changesets/cli": "^2.23.2", - "@greymass/abi2core": "^2.0.1", - "@size-limit/preset-big-lib": "^11.1.2", - "@types/bun": "^1.1.1", - "typescript": "5.4.2", - "vite": "^5.0.7" - }, - "trustedDependencies": ["@biomejs/biome"], - "dependencies": { - "@wharfkit/transact-plugin-autocorrect": "^1.2.1", - "gh-pages": "^6.1.1" - } + "name": "@effectai/sdk", + "workspaces": ["docs", "src"], + "scripts": { + "test": "bun --env-file=.env test", + "test:watch": "bun --env-file=.env test --watch", + "test:only": "bun --env-file=.env test --watch --only", + "test:coverage": "bun --env-file=.env test --coverage", + "dev": "tsc -w --project src/tsconfig.build.json", + "build": "bun run sdk:build && bun run docs:build", + "lint": "biome lint --apply .", + "format": "biome format --write .", + "check": "biome check --apply .", + "changeset": "changeset", + "changeset:public": "bun scripts/updateVersion.ts && bun run build && changeset publish", + "changeset:version": "changeset version && bun install --frozen-lockfile && bun scripts/updateVersion.ts", + "changeset:publish": "bun run build && changeset publish", + "docs:dev": "cd docs && bun run dev", + "docs:build": "cd docs && bun run build", + "docs:preview": "cd docs && bun run preview", + "sdk:build": "tsc --project src/tsconfig.build.json --module es2020", + "link": "cd src && bun link" + }, + "devDependencies": { + "@biomejs/biome": "1.7.0", + "@wharfkit/wallet-plugin-privatekey": "^1.0.0", + "@changesets/changelog-github": "^0.4.5", + "@changesets/cli": "^2.23.2", + "@greymass/abi2core": "^2.0.1", + "@size-limit/preset-big-lib": "^11.1.2", + "@types/bun": "^1.1.1", + "typescript": "5.4.2", + "vite": "^5.0.7" + }, + "trustedDependencies": ["@biomejs/biome"], + "dependencies": { + "@wharfkit/transact-plugin-autocorrect": "^1.2.1", + "gh-pages": "^6.1.1" + } } diff --git a/src/@generated/types/tasks.efx.ts b/src/@generated/types/tasks.efx.ts index 5b71079c..2fe56dac 100644 --- a/src/@generated/types/tasks.efx.ts +++ b/src/@generated/types/tasks.efx.ts @@ -1,34 +1,141 @@ -import type { BytesType, Checksum160, Checksum160Type, Int8, UInt64 } from "@wharfkit/antelope"; - +import type { + BytesType, + Checksum160, + Checksum160Type, + Int8, + UInt64, +} from "@wharfkit/antelope"; + export type BVectorUint64E = UInt64[]; export type QUALIATOMICADDRESS = VariantNameUint32Uint64; export type Address = Checksum160; export type Content = TupleUint8String; export type Vaddress = VariantAddressName; -export type VariantAddressName = [ string, string ]; -export type VariantNameUint32Uint64 = [ string, number, number ]; +export type VariantAddressName = [string, string]; +export type VariantNameUint32Uint64 = [string, number, number]; -export type Quali = { type: number; address: QUALIATOMICADDRESS; data_filter?: QualiDataFilter; }; -export type QualiDataFilter = { attr_id: number; filter_type: number; data: string; }; -export type Acctaskidx = { account_id: number; campaign_id: number; batch_idx: number; value: number; }; -export type Batch = { id: number; campaign_id: number; content: Content; balance: {quantity: string, contract: string}; repetitions: number; num_tasks: number; start_task_idx: number; reward: {quantity: string, contract: string}; }; -export type Campaign = { id: number; reservations_done: number; total_submissions: number; total_tasks: number; active_batch: number; num_batches: number; owner: Vaddress; paused: boolean; content: Content; max_task_time: number; reward: {quantity: string, contract: string}; qualis: Quali[]; }; -export type Cleartasks = { batch_id: number; campaign_id: number; }; -export type Editcampaign = { campaign_id: number; owner: Vaddress; content: Content; paused: boolean; reward: {quantity: string, contract: string}; qualis: Quali[]; payer: string; }; -export type Init = { vaccount_contract: string; force_vaccount_id: number; payout_delay_sec: number; release_task_delay_sec: number; fee_contract: string; fee_percentage: number; }; -export type Mkbatch = { id: number; campaign_id: number; content: Content; repetitions: number; payer: string; }; -export type Mkcampaign = { owner: Vaddress; content: Content; max_task_time: number; reward: {quantity: string, contract: string}; qualis: Quali[]; payer: string; }; -export type PairInt8Bytes = { first: Int8; second: string; }; -export type Payment = { id: number; account_id: number; batch_id: number; pending: {quantity: string, contract: string}; last_submission_time: string; }; -export type Payout = { payment_id: number; }; -export type Publishbatch = { batch_id: number; num_tasks: number; }; -export type Repsdone = { campaign_id: number; task_idx: number; value: number; }; -export type Reservation = { id: number; task_idx: number; account_id?: number; batch_idx: number; reserved_on: string; campaign_id: number; }; -export type Reservetask = { campaign_id: number; account_id: number; quali_assets?: BVectorUint64E; }; -export type Rmbatch = { id: number; campaign_id: number; }; -export type Rmcampaign = { campaign_id: number; owner: Vaddress; }; -export type Settings = { vaccount_contract: string; force_vaccount_id: number; payout_delay_sec: number; release_task_delay_sec: number; fee_contract: string; fee_percentage: number; }; -export type Submission = { id: number; campaign_id: number; task_idx: number; account_id?: number; batch_idx: number; data: PairInt8Bytes; paid: boolean; submitted_on: string; }; -export type Submittask = { campaign_id: number; task_idx: number; data: PairInt8Bytes; account_id: number; }; -export type TupleUint8String = { field_0: number; field_1: string; }; \ No newline at end of file +export type Quali = { + type: number; + address: QUALIATOMICADDRESS; + data_filter?: QualiDataFilter; +}; +export type QualiDataFilter = { + attr_id: number; + filter_type: number; + data: string; +}; +export type Acctaskidx = { + account_id: number; + campaign_id: number; + batch_idx: number; + value: number; +}; +export type Batch = { + id: number; + campaign_id: number; + content: Content; + balance: { quantity: string; contract: string }; + repetitions: number; + num_tasks: number; + start_task_idx: number; + reward: { quantity: string; contract: string }; +}; +export type Campaign = { + id: number; + reservations_done: number; + total_submissions: number; + total_tasks: number; + active_batch: number; + num_batches: number; + owner: Vaddress; + paused: boolean; + content: Content; + max_task_time: number; + reward: { quantity: string; contract: string }; + qualis: Quali[]; +}; +export type Cleartasks = { batch_id: number; campaign_id: number }; +export type Editcampaign = { + campaign_id: number; + owner: Vaddress; + content: Content; + paused: boolean; + reward: { quantity: string; contract: string }; + qualis: Quali[]; + payer: string; +}; +export type Init = { + vaccount_contract: string; + force_vaccount_id: number; + payout_delay_sec: number; + release_task_delay_sec: number; + fee_contract: string; + fee_percentage: number; +}; +export type Mkbatch = { + id: number; + campaign_id: number; + content: Content; + repetitions: number; + payer: string; +}; +export type Mkcampaign = { + owner: Vaddress; + content: Content; + max_task_time: number; + reward: { quantity: string; contract: string }; + qualis: Quali[]; + payer: string; +}; +export type PairInt8Bytes = { first: Int8; second: string }; +export type Payment = { + id: number; + account_id: number; + batch_id: number; + pending: { quantity: string; contract: string }; + last_submission_time: string; +}; +export type Payout = { payment_id: number }; +export type Publishbatch = { batch_id: number; num_tasks: number }; +export type Repsdone = { campaign_id: number; task_idx: number; value: number }; +export type Reservation = { + id: number; + task_idx: number; + account_id?: number; + batch_idx: number; + reserved_on: string; + campaign_id: number; +}; +export type Reservetask = { + campaign_id: number; + account_id: number; + quali_assets?: BVectorUint64E; +}; +export type Rmbatch = { id: number; campaign_id: number }; +export type Rmcampaign = { campaign_id: number; owner: Vaddress }; +export type Settings = { + vaccount_contract: string; + force_vaccount_id: number; + payout_delay_sec: number; + release_task_delay_sec: number; + fee_contract: string; + fee_percentage: number; +}; +export type Submission = { + id: number; + campaign_id: number; + task_idx: number; + account_id?: number; + batch_idx: number; + data: PairInt8Bytes; + paid: boolean; + submitted_on: string; +}; +export type Submittask = { + campaign_id: number; + task_idx: number; + data: PairInt8Bytes; + account_id: number; +}; +export type TupleUint8String = { field_0: number; field_1: string }; diff --git a/src/@generated/types/vaccount.efx.ts b/src/@generated/types/vaccount.efx.ts index 3ca4d3da..33c7719f 100644 --- a/src/@generated/types/vaccount.efx.ts +++ b/src/@generated/types/vaccount.efx.ts @@ -1,12 +1,37 @@ -import type { BytesType, Checksum160, Checksum160Type, Signature, UInt64 } from "@wharfkit/antelope"; - +import type { + BytesType, + Checksum160, + Checksum160Type, + Signature, + UInt64, +} from "@wharfkit/antelope"; + export type Address = Checksum160; export type Vaddress = VariantAddressName; -export type VariantAddressName = [ string, string ]; +export type VariantAddressName = [string, string]; -export type Account = { id: number; nonce: number; address: Vaddress; balance: {quantity: string, contract: string}; }; -export type ExtendedSymbol = { sym: symbol; contract: string; }; -export type Open = { acc: Vaddress; symbol: ExtendedSymbol; payer: string; }; -export type Vtransfer = { from_id: number; to_id: number; quantity: {quantity: string, contract: string}; memo: string; sig?: Signature; fee?: {quantity: string, contract: string}; }; -export type Withdraw = { from_id: number; to_account: string; quantity: {quantity: string, contract: string}; memo: string; sig?: Signature; fee?: {quantity: string, contract: string}; }; \ No newline at end of file +export type Account = { + id: number; + nonce: number; + address: Vaddress; + balance: { quantity: string; contract: string }; +}; +export type ExtendedSymbol = { sym: symbol; contract: string }; +export type Open = { acc: Vaddress; symbol: ExtendedSymbol; payer: string }; +export type Vtransfer = { + from_id: number; + to_id: number; + quantity: { quantity: string; contract: string }; + memo: string; + sig?: Signature; + fee?: { quantity: string; contract: string }; +}; +export type Withdraw = { + from_id: number; + to_account: string; + quantity: { quantity: string; contract: string }; + memo: string; + sig?: Signature; + fee?: { quantity: string; contract: string }; +}; diff --git a/src/actions/tasks/getTask.ts b/src/actions/tasks/getTask.ts index 9d1e880e..9d240593 100644 --- a/src/actions/tasks/getTask.ts +++ b/src/actions/tasks/getTask.ts @@ -54,8 +54,6 @@ export const getTaskDataByReservation = ( client: Client, reservation: Reservation, ) => { - - return getTaskData({ client, taskIndex: reservation.task_idx,