@drift-labs/sdk 2.28.0-beta.3 → 2.28.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.d.ts +1 -0
- package/lib/config.js +4 -3
- package/lib/constants/perpMarkets.js +20 -0
- package/lib/dlob/DLOBSubscriber.js +1 -1
- package/lib/driftClient.d.ts +62 -7
- package/lib/driftClient.js +186 -66
- package/lib/driftClientConfig.d.ts +4 -3
- package/lib/idl/drift.json +856 -1
- package/lib/math/spotMarket.d.ts +1 -1
- package/lib/math/spotMarket.js +6 -1
- package/lib/math/utils.d.ts +9 -0
- package/lib/math/utils.js +39 -1
- package/lib/phoenix/phoenixSubscriber.js +1 -2
- package/lib/tx/retryTxSender.d.ts +1 -1
- package/lib/tx/retryTxSender.js +1 -2
- package/lib/tx/types.d.ts +1 -1
- package/lib/types.d.ts +0 -1
- package/lib/types.js +0 -1
- package/lib/user.d.ts +8 -0
- package/lib/user.js +18 -0
- package/package.json +1 -1
- package/src/config.ts +4 -2
- package/src/constants/perpMarkets.ts +20 -0
- package/src/dlob/DLOBSubscriber.ts +2 -2
- package/src/driftClient.ts +273 -138
- package/src/driftClientConfig.ts +9 -3
- package/src/idl/drift.json +857 -2
- package/src/math/spotMarket.ts +6 -2
- package/src/math/utils.ts +46 -0
- package/src/phoenix/phoenixSubscriber.ts +4 -2
- package/src/tx/retryTxSender.ts +1 -9
- package/src/tx/types.ts +1 -2
- package/src/types.ts +0 -2
- package/src/user.ts +28 -0
- package/tests/insurance/test.ts +40 -0
package/src/driftClientConfig.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ConfirmOptions,
|
|
3
|
+
Connection,
|
|
4
|
+
PublicKey,
|
|
5
|
+
TransactionVersion,
|
|
6
|
+
} from '@solana/web3.js';
|
|
2
7
|
import { IWallet } from './types';
|
|
3
8
|
import { OracleInfo } from './oracles/types';
|
|
4
9
|
import { BulkAccountLoader } from './accounts/bulkAccountLoader';
|
|
@@ -7,7 +12,8 @@ import { DriftEnv } from './config';
|
|
|
7
12
|
export type DriftClientConfig = {
|
|
8
13
|
connection: Connection;
|
|
9
14
|
wallet: IWallet;
|
|
10
|
-
|
|
15
|
+
env?: DriftEnv;
|
|
16
|
+
programID?: PublicKey;
|
|
11
17
|
accountSubscription?: DriftClientSubscriptionConfig;
|
|
12
18
|
opts?: ConfirmOptions;
|
|
13
19
|
txSenderConfig?: TxSenderConfig;
|
|
@@ -17,12 +23,12 @@ export type DriftClientConfig = {
|
|
|
17
23
|
spotMarketIndexes?: number[];
|
|
18
24
|
marketLookupTable?: PublicKey;
|
|
19
25
|
oracleInfos?: OracleInfo[];
|
|
20
|
-
env?: DriftEnv;
|
|
21
26
|
userStats?: boolean;
|
|
22
27
|
authority?: PublicKey; // explicitly pass an authority if signer is delegate
|
|
23
28
|
includeDelegates?: boolean; // flag for whether to load delegate accounts as well
|
|
24
29
|
authoritySubAccountMap?: Map<string, number[]>; // if passed this will override subAccountIds and includeDelegates
|
|
25
30
|
skipLoadUsers?: boolean; // if passed to constructor, no user accounts will be loaded. they will load if updateWallet is called afterwards.
|
|
31
|
+
txVersion?: TransactionVersion; // which tx version to use
|
|
26
32
|
};
|
|
27
33
|
|
|
28
34
|
export type DriftClientSubscriptionConfig =
|