diff --git a/src/api.ts b/src/api.ts index 137151a..9e74458 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,4 +1,5 @@ import type { CaipChainId } from '@metamask/utils'; + import type { CaipAssetType } from './caip-types'; import type { BalancesResult } from './types'; diff --git a/src/caip-types.test.ts b/src/caip-types.test.ts index 62affa9..a1f76bf 100644 --- a/src/caip-types.test.ts +++ b/src/caip-types.test.ts @@ -1,7 +1,4 @@ -import { - isCaipAssetType, - isCaipAssetId, -} from './caip-types'; +import { isCaipAssetType, isCaipAssetId } from './caip-types'; describe('isCaipAssetType', () => { // Imported from: https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-19.md#test-cases diff --git a/src/caip-types.ts b/src/caip-types.ts index 57a226f..2fc273c 100644 --- a/src/caip-types.ts +++ b/src/caip-types.ts @@ -1,13 +1,3 @@ -import type { - CaipChainId, - CaipNamespace, - CaipReference, -} from '@metamask/utils'; -import { - CaipChainIdStruct, - CaipNamespaceStruct, - CaipReferenceStruct, -} from '@metamask/utils'; import type { Infer } from 'superstruct'; import { is, string, pattern } from 'superstruct'; diff --git a/src/rpc-handler.ts b/src/rpc-handler.ts index a249357..a84ca56 100644 --- a/src/rpc-handler.ts +++ b/src/rpc-handler.ts @@ -1,8 +1,7 @@ -import type { Json, JsonRpcRequest } from '@metamask/utils'; +import type { Json, JsonRpcRequest, CaipChainId } from '@metamask/utils'; import { assert } from 'superstruct'; import type { Chain } from './api'; -import type { CaipChainId } from '@metamask/utils'; import { JsonRpcRequestStruct } from './JsonRpcRequest'; import { GetBalancesRequestStruct } from './rpc-types'; diff --git a/src/rpc-types.ts b/src/rpc-types.ts index 89c39a3..d6f473d 100644 --- a/src/rpc-types.ts +++ b/src/rpc-types.ts @@ -1,3 +1,4 @@ +import { CaipChainIdStruct } from '@metamask/utils'; import type { Infer } from 'superstruct'; import { record, @@ -9,7 +10,6 @@ import { literal, } from 'superstruct'; -import { CaipChainIdStruct } from '@metamask/utils'; import { CaipAssetTypeStruct } from './caip-types'; export const AmountStruct = object({}); diff --git a/src/types.test.ts b/src/types.test.ts index 9b97616..7267a37 100644 --- a/src/types.test.ts +++ b/src/types.test.ts @@ -1,27 +1,21 @@ -import { is, literal, max, number, string, union } from 'superstruct'; +import { is } from 'superstruct'; import { StringNumberStruct } from './types'; describe('types', () => { describe('StringNumber', () => { - it.each([ - '0', - '0.0', - '0.1', - '0.19', - '00.19', - '0.000000000000000000000', - ])('validates basic number: %s', (input: string) => { - expect(is(input, StringNumberStruct)).toBe(true); - }); + it.each(['0', '0.0', '0.1', '0.19', '00.19', '0.000000000000000000000'])( + 'validates basic number: %s', + (input: string) => { + expect(is(input, StringNumberStruct)).toBe(true); + }, + ); - it.each([ - 'foobar', - 'NaN', - '0.123.4', - '1e3', - ])('fails to validate wrong number: %s', (input: string) => { - expect(is(input, StringNumberStruct)).toBe(false); - }); + it.each(['foobar', 'NaN', '0.123.4', '1e3'])( + 'fails to validate wrong number: %s', + (input: string) => { + expect(is(input, StringNumberStruct)).toBe(false); + }, + ); }); });