diff --git a/packages/blockchain-link/src/index.ts b/packages/blockchain-link/src/index.ts index 7cd3246daa..0c5ab7a2a2 100644 --- a/packages/blockchain-link/src/index.ts +++ b/packages/blockchain-link/src/index.ts @@ -1,7 +1,6 @@ -import { createDeferred, createDeferredManager, TypedEmitter } from '@trezor/utils'; +import { createDeferred, createDeferredManager, TypedEmitter, Throttler } from '@trezor/utils'; import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; import { MESSAGES, RESPONSES } from '@trezor/blockchain-link-types/src/constants'; -import { Throttler } from './workers/throttler'; import type { BlockchainSettings } from '@trezor/blockchain-link-types'; import type * as ResponseTypes from '@trezor/blockchain-link-types/src/responses'; import type * as MessageTypes from '@trezor/blockchain-link-types/src/messages'; diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index f3ddb5d69d..da64f6f32f 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -41,3 +41,4 @@ export * from './urlToOnion'; export * from './logs'; export * from './logsManager'; export * from './bigNumber'; +export * from './throttler'; diff --git a/packages/blockchain-link/src/workers/throttler.ts b/packages/utils/src/throttler.ts similarity index 100% rename from packages/blockchain-link/src/workers/throttler.ts rename to packages/utils/src/throttler.ts diff --git a/packages/blockchain-link/tests/unit/throttler.test.ts b/packages/utils/tests/throttler.test.ts similarity index 97% rename from packages/blockchain-link/tests/unit/throttler.test.ts rename to packages/utils/tests/throttler.test.ts index 67c11a2b4e..0492059fc7 100644 --- a/packages/blockchain-link/tests/unit/throttler.test.ts +++ b/packages/utils/tests/throttler.test.ts @@ -1,4 +1,4 @@ -import { Throttler } from '../../src/workers/throttler'; +import { Throttler } from '../src/throttler'; const delay = (ms: number) => jest.advanceTimersByTime(ms);