Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: impl await task completion for externally managed keys #139

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/src/actions/getTaskHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getWalletId } from './getWalletId.js'
import { getRelayerWithAuth } from '../utils/http.js'

import { TASK_HISTORY_ROUTE } from '../constants.js'
import type { Config } from '../createConfig.js'
import type { RenegadeConfig } from '../createConfig.js'
import { BaseError, type BaseErrorType } from '../errors/base.js'
import type { Task as TaskHistoryItem } from '../types/task.js'

Expand All @@ -12,7 +12,7 @@ export type GetTaskHistoryReturnType = Map<string, TaskHistoryItem>
export type GetTaskHistoryErrorType = BaseErrorType

export async function getTaskHistory(
config: Config,
config: RenegadeConfig,
): Promise<GetTaskHistoryReturnType> {
const { getBaseUrl } = config
const walletId = getWalletId(config)
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/waitForTaskCompletionWs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TASK_STATUS_ROUTE } from '../constants.js'
import type { Config } from '../createConfig.js'
import type { RenegadeConfig } from '../createConfig.js'
import { AuthType } from '../utils/websocket.js'
import {
type WebsocketWaiterParams,
Expand All @@ -9,7 +9,7 @@ import { getTaskHistory } from './getTaskHistory.js'
import type { WaitForTaskCompletionParameters } from './waitForTaskCompletion.js'

export async function waitForTaskCompletionWs(
config: Config,
config: RenegadeConfig,
parameters: WaitForTaskCompletionParameters,
): Promise<null | undefined> {
const { id, timeout } = parameters
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/utils/websocket.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SIG_EXPIRATION_BUFFER_MS } from '../constants.js'
import type { Config } from '../createConfig.js'
import type { RenegadeConfig } from '../createConfig.js'
import { addExpiringAuthToHeaders } from './http.js'

export enum AuthType {
Expand All @@ -9,7 +9,7 @@ export enum AuthType {
}

export type RelayerWebsocketParams = {
config: Config
config: RenegadeConfig
topic: string
authType: AuthType
onmessage: (this: WebSocket, ev: MessageEvent) => any
Expand Down Expand Up @@ -38,7 +38,7 @@ export type UnsubscriptionBody = {
}

export class RelayerWebsocket {
private config: Config
private config: RenegadeConfig
private topic: string
private authType: AuthType
private onmessage: (this: WebSocket, ev: MessageEvent) => any
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/websocketWaiter.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Config } from '../createConfig.js'
import type { RenegadeConfig } from '../createConfig.js'
import {
type AuthType,
RelayerWebsocket,
type RelayerWebsocketParams,
} from './websocket.js'

export type WebsocketWaiterParams = {
config: Config
config: RenegadeConfig
topic: string
authType: AuthType
messageHandler: (message: any) => any | undefined
Expand Down
Loading