@drift-labs/sdk 2.145.0-beta.2 → 2.145.0-beta.3
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/VERSION +1 -1
- package/lib/browser/accounts/types.d.ts +13 -1
- package/lib/browser/accounts/webSocketProgramAccountSubscriberV2.d.ts +53 -0
- package/lib/browser/accounts/webSocketProgramAccountSubscriberV2.js +453 -0
- package/lib/browser/addresses/pda.d.ts +9 -0
- package/lib/browser/addresses/pda.js +60 -1
- package/lib/browser/adminClient.d.ts +160 -8
- package/lib/browser/adminClient.js +754 -18
- package/lib/browser/constituentMap/constituentMap.d.ts +64 -0
- package/lib/browser/constituentMap/constituentMap.js +170 -0
- package/lib/browser/constituentMap/pollingConstituentAccountSubscriber.d.ts +24 -0
- package/lib/browser/constituentMap/pollingConstituentAccountSubscriber.js +60 -0
- package/lib/browser/constituentMap/webSocketConstituentAccountSubscriber.d.ts +24 -0
- package/lib/browser/constituentMap/webSocketConstituentAccountSubscriber.js +58 -0
- package/lib/browser/driftClient.d.ts +89 -2
- package/lib/browser/driftClient.js +486 -27
- package/lib/browser/driftClientConfig.d.ts +2 -7
- package/lib/browser/idl/drift.json +4303 -1379
- package/lib/browser/index.d.ts +1 -4
- package/lib/browser/index.js +2 -9
- package/lib/browser/memcmp.d.ts +3 -1
- package/lib/browser/memcmp.js +19 -1
- package/lib/browser/types.d.ts +147 -0
- package/lib/browser/types.js +13 -1
- package/lib/node/accounts/types.d.ts +13 -1
- package/lib/node/accounts/types.d.ts.map +1 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.d.ts +54 -0
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.d.ts.map +1 -0
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.js +453 -0
- package/lib/node/addresses/pda.d.ts +9 -0
- package/lib/node/addresses/pda.d.ts.map +1 -1
- package/lib/node/addresses/pda.js +60 -1
- package/lib/node/adminClient.d.ts +160 -8
- package/lib/node/adminClient.d.ts.map +1 -1
- package/lib/node/adminClient.js +754 -18
- package/lib/node/constituentMap/constituentMap.d.ts +65 -0
- package/lib/node/constituentMap/constituentMap.d.ts.map +1 -0
- package/lib/node/constituentMap/constituentMap.js +170 -0
- package/lib/node/constituentMap/pollingConstituentAccountSubscriber.d.ts +25 -0
- package/lib/node/constituentMap/pollingConstituentAccountSubscriber.d.ts.map +1 -0
- package/lib/node/constituentMap/pollingConstituentAccountSubscriber.js +60 -0
- package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.d.ts +25 -0
- package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.d.ts.map +1 -0
- package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.js +58 -0
- package/lib/node/driftClient.d.ts +89 -2
- package/lib/node/driftClient.d.ts.map +1 -1
- package/lib/node/driftClient.js +486 -27
- package/lib/node/driftClientConfig.d.ts +2 -7
- package/lib/node/driftClientConfig.d.ts.map +1 -1
- package/lib/node/idl/drift.json +4303 -1379
- package/lib/node/index.d.ts +1 -4
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +2 -9
- package/lib/node/memcmp.d.ts +3 -1
- package/lib/node/memcmp.d.ts.map +1 -1
- package/lib/node/memcmp.js +19 -1
- package/lib/node/types.d.ts +147 -0
- package/lib/node/types.d.ts.map +1 -1
- package/lib/node/types.js +13 -1
- package/package.json +1 -1
- package/src/accounts/types.ts +20 -0
- package/src/accounts/webSocketProgramAccountSubscriberV2.ts +596 -0
- package/src/addresses/pda.ts +115 -1
- package/src/adminClient.ts +1612 -41
- package/src/constituentMap/constituentMap.ts +285 -0
- package/src/constituentMap/pollingConstituentAccountSubscriber.ts +97 -0
- package/src/constituentMap/webSocketConstituentAccountSubscriber.ts +112 -0
- package/src/driftClient.ts +1097 -17
- package/src/driftClientConfig.ts +8 -15
- package/src/idl/drift.json +4303 -1379
- package/src/index.ts +1 -4
- package/src/memcmp.ts +23 -1
- package/src/types.ts +160 -0
package/src/driftClientConfig.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PublicKey,
|
|
6
6
|
TransactionVersion,
|
|
7
7
|
} from '@solana/web3.js';
|
|
8
|
-
import { IWallet, TxParams
|
|
8
|
+
import { IWallet, TxParams } from './types';
|
|
9
9
|
import { OracleInfo } from './oracles/types';
|
|
10
10
|
import { BulkAccountLoader } from './accounts/bulkAccountLoader';
|
|
11
11
|
import { DriftEnv } from './config';
|
|
@@ -19,9 +19,6 @@ import {
|
|
|
19
19
|
import { Coder, Program } from '@coral-xyz/anchor';
|
|
20
20
|
import { WebSocketAccountSubscriber } from './accounts/webSocketAccountSubscriber';
|
|
21
21
|
import { WebSocketAccountSubscriberV2 } from './accounts/webSocketAccountSubscriberV2';
|
|
22
|
-
import { WebSocketProgramAccountSubscriber } from './accounts/webSocketProgramAccountSubscriber';
|
|
23
|
-
import { WebSocketDriftClientAccountSubscriberV2 } from './accounts/webSocketDriftClientAccountSubscriberV2';
|
|
24
|
-
import { WebSocketDriftClientAccountSubscriber } from './accounts/webSocketDriftClientAccountSubscriber';
|
|
25
22
|
import { grpcDriftClientAccountSubscriberV2 } from './accounts/grpcDriftClientAccountSubscriberV2';
|
|
26
23
|
import { grpcDriftClientAccountSubscriber } from './accounts/grpcDriftClientAccountSubscriber';
|
|
27
24
|
import { grpcMultiUserAccountSubscriber } from './accounts/grpcMultiUserAccountSubscriber';
|
|
@@ -81,7 +78,6 @@ export type DriftClientSubscriptionConfig =
|
|
|
81
78
|
resubTimeoutMs?: number;
|
|
82
79
|
logResubMessages?: boolean;
|
|
83
80
|
commitment?: Commitment;
|
|
84
|
-
programUserAccountSubscriber?: WebSocketProgramAccountSubscriber<UserAccount>;
|
|
85
81
|
perpMarketAccountSubscriber?: new (
|
|
86
82
|
accountName: string,
|
|
87
83
|
program: Program,
|
|
@@ -90,17 +86,14 @@ export type DriftClientSubscriptionConfig =
|
|
|
90
86
|
resubOpts?: ResubOpts,
|
|
91
87
|
commitment?: Commitment
|
|
92
88
|
) => WebSocketAccountSubscriberV2<any> | WebSocketAccountSubscriber<any>;
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
oracleAccountSubscriber?: new (
|
|
90
|
+
accountName: string,
|
|
95
91
|
program: Program,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
) =>
|
|
102
|
-
| WebSocketDriftClientAccountSubscriber
|
|
103
|
-
| WebSocketDriftClientAccountSubscriberV2;
|
|
92
|
+
accountPublicKey: PublicKey,
|
|
93
|
+
decodeBuffer?: (buffer: Buffer) => any,
|
|
94
|
+
resubOpts?: ResubOpts,
|
|
95
|
+
commitment?: Commitment
|
|
96
|
+
) => WebSocketAccountSubscriberV2<any> | WebSocketAccountSubscriber<any>;
|
|
104
97
|
}
|
|
105
98
|
| {
|
|
106
99
|
type: 'polling';
|