diff --git a/packages/worker-api/src/integriteeWorker.ts b/packages/worker-api/src/integriteeWorker.ts index 9f711170..9327bebf 100644 --- a/packages/worker-api/src/integriteeWorker.ts +++ b/packages/worker-api/src/integriteeWorker.ts @@ -7,13 +7,12 @@ import type { import { type CallOptions, type ISubmittableGetter, - type IWorker, Request, type JsonRpcRequest, } from './interface.js'; +import {Worker} from "./worker.js"; import {callGetter, sendTrustedCall, sendWorkerRequest} from './sendRequest.js'; import {createGetterRpc, createTrustedCall, signTrustedCall, submittableGetter} from "./requests.js"; -import {Worker} from "./worker.js"; import bs58 from "bs58"; import type {Signer} from "@polkadot/types/types"; import type {AddressOrPair} from "@polkadot/api-base/types/submittable"; @@ -96,7 +95,7 @@ export class IntegriteeWorker extends Worker { } } -export class SubmittableGetter implements ISubmittableGetter { +export class SubmittableGetter implements ISubmittableGetter { worker: W; shard: ShardIdentifier; getter: IntegriteeGetter; diff --git a/packages/worker-api/src/interface.ts b/packages/worker-api/src/interface.ts index e3ffaecb..40457cac 100644 --- a/packages/worker-api/src/interface.ts +++ b/packages/worker-api/src/interface.ts @@ -3,8 +3,9 @@ import {Keyring} from "@polkadot/keyring"; import type {u8} from "@polkadot/types-codec"; import type {TypeRegistry, Vec} from "@polkadot/types"; import type {RegistryTypes, Signer} from "@polkadot/types/types"; -import type {IntegriteeGetter, ShardIdentifier} from "@encointer/types"; import type {AddressOrPair} from "@polkadot/api-base/types/submittable"; +import {Worker} from "./worker.js"; +import type {IntegriteeGetter, ShardIdentifier} from "@encointer/types"; export interface IWorker extends WebSocketAsPromised { rsCount: number; @@ -16,7 +17,7 @@ export interface IWorker extends WebSocketAsPromised { registry: () => TypeRegistry } -export interface ISubmittableGetter { +export interface ISubmittableGetter { worker: W; diff --git a/packages/worker-api/src/requests.ts b/packages/worker-api/src/requests.ts index 0c56ff14..57cd24eb 100644 --- a/packages/worker-api/src/requests.ts +++ b/packages/worker-api/src/requests.ts @@ -1,5 +1,6 @@ import {createJsonRpcRequest, type IWorker, type PublicGetterArgs, type TrustedGetterArgs} from "./interface.js"; import {SubmittableGetter} from "./integriteeWorker.js"; +import {Worker} from "./worker.js"; import type { BalanceTransferArgs, BalanceUnshieldArgs, @@ -32,7 +33,7 @@ export const clientRequestGetterRpc = (self: IWorker, request: string, args: Pub return createGetterRpc(self, g, shardT); } -export const submittableGetter = async (self: W, request: string, args: TrustedGetterArgs, returnType: string)=> { +export const submittableGetter = async (self: W, request: string, args: TrustedGetterArgs, returnType: string)=> { const {shard, account} = args; const shardT = self.createType('ShardIdentifier', bs58.decode(shard)); const signedGetter = await createSignedGetter(self, request, account)