File tree Expand file tree Collapse file tree 6 files changed +26
-12
lines changed Expand file tree Collapse file tree 6 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,16 @@ module.exports = {
37
37
// Restrict importing BN from bn.js
38
38
"group" : [ "bn.js" ] ,
39
39
"message" : "Import BN from @drift-labs/sdk instead" ,
40
- }
40
+ } ,
41
+ {
42
+ // Prevent imports from index files within the same package
43
+ group : [
44
+ '**/index' ,
45
+ '**/index.ts' ,
46
+ ] ,
47
+ message :
48
+ 'Do not import from index file within the same package. Import directly from source files instead. This prevents barrel imports.' ,
49
+ } ,
41
50
] ,
42
51
} ,
43
52
] ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import {
21
21
FuelSeasonRecord ,
22
22
InsuranceFundSwapRecord ,
23
23
TransferProtocolIfSharesToRevenuePoolRecord ,
24
- } from '../index ' ;
24
+ } from '../types ' ;
25
25
import { EventEmitter } from 'events' ;
26
26
27
27
export type EventSubscriptionOptions = {
Original file line number Diff line number Diff line change 1
1
import { PERCENTAGE_PRECISION , ZERO } from '../constants/numericConstants' ;
2
- import { BN , SpotMarketAccount , SpotBalanceType } from '../index' ;
3
2
import { getTokenAmount } from '../math/spotBalance' ;
3
+ import { BN } from '@coral-xyz/anchor' ;
4
+ import { SpotBalanceType , SpotMarketAccount } from '../types' ;
4
5
5
6
export function nextRevenuePoolSettleApr (
6
7
spotMarket : SpotMarketAccount ,
Original file line number Diff line number Diff line change 1
- import { AMM , OracleGuardRails , isVariant } from '../types' ;
1
+ import {
2
+ AMM ,
3
+ HistoricalOracleData ,
4
+ OracleGuardRails ,
5
+ OracleSource ,
6
+ PerpMarketAccount ,
7
+ isVariant ,
8
+ } from '../types' ;
2
9
import { OraclePriceData } from '../oracles/types' ;
3
10
import {
4
11
BID_ASK_SPREAD_PRECISION ,
@@ -9,13 +16,8 @@ import {
9
16
FIVE_MINUTE ,
10
17
PERCENTAGE_PRECISION ,
11
18
} from '../constants/numericConstants' ;
12
- import {
13
- BN ,
14
- HistoricalOracleData ,
15
- OracleSource ,
16
- PerpMarketAccount ,
17
- } from '../index' ;
18
19
import { assert } from '../assert/assert' ;
20
+ import { BN } from '@coral-xyz/anchor' ;
19
21
20
22
export function oraclePriceBands (
21
23
market : PerpMarketAccount ,
Original file line number Diff line number Diff line change @@ -13,12 +13,13 @@ import { PollingSubscription } from './PollingSubscription';
13
13
import { WebsocketSubscription } from './WebsocketSubscription' ;
14
14
import StrictEventEmitter from 'strict-event-emitter-types' ;
15
15
import { EventEmitter } from 'events' ;
16
- import { calculateOrderBaseAssetAmount , ZERO } from '../index' ;
17
16
import { BN } from '@coral-xyz/anchor' ;
18
17
import { ProtectMakerParamsMap } from '../dlob/types' ;
19
18
import { decodeUser } from '../decode/user' ;
20
19
import { grpcSubscription } from './grpcSubscription' ;
21
20
import { isUserProtectedMaker } from '../math/userStatus' ;
21
+ import { calculateOrderBaseAssetAmount } from '../math/orders' ;
22
+ import { ZERO } from '../constants/numericConstants' ;
22
23
23
24
export class OrderSubscriber {
24
25
driftClient : DriftClient ;
Original file line number Diff line number Diff line change 1
- import { BN , numberToSafeBN } from '../../src/index' ;
2
1
import { expect } from 'chai' ;
3
2
import { BigNum } from '../../src/factory/bigNum' ;
4
3
import {
7
6
BASE_PRECISION_EXP ,
8
7
TEN_THOUSAND ,
9
8
} from '../../src/constants/numericConstants' ;
9
+ import { BN } from '@coral-xyz/anchor' ;
10
+ import { numberToSafeBN } from '../../src/math/utils' ;
10
11
11
12
// if you used the '@types/mocha' method to install mocha type definitions, uncomment the following line
12
13
// import 'mocha';
You can’t perform that action at this time.
0 commit comments