Skip to content

Commit

Permalink
fix: cannot infer ts2742 types from starknet-types@0.7
Browse files Browse the repository at this point in the history
the externalization of types in starknet-types prevent typescript from inferring
a type that are not available in the project. To workaround this issue, this
commit imports the SPEC type so that the inference can happen
  • Loading branch information
0xknwn committed Apr 24, 2024
1 parent 7587417 commit 55ced7a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/account/default.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { SPEC } from 'starknet-types-07';
import { UDC, ZERO } from '../constants';
import { Provider, ProviderInterface } from '../provider';
import { Signer, SignerInterface } from '../signer';
Expand Down
2 changes: 2 additions & 0 deletions src/utils/stark.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { SPEC } from 'starknet-types-07';
import { getStarkKey, utils } from '@scure/starknet';
import { gzip, ungzip } from 'pako';

Expand Down
2 changes: 2 additions & 0 deletions src/wallet/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
type AddStarknetChainParameters,
type NetworkChangeEventHandler,
type WatchAssetParameters,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type SPEC,
} from 'starknet-types-07';

import { Account, AccountInterface } from '../account';
Expand Down
2 changes: 2 additions & 0 deletions src/wallet/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
type ChainId,
type StarknetWindowObject,
type TypedData,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type SPEC,
} from 'starknet-types-07';

/**
Expand Down

0 comments on commit 55ced7a

Please sign in to comment.