@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.
Files changed (73) hide show
  1. package/VERSION +1 -1
  2. package/lib/browser/accounts/types.d.ts +13 -1
  3. package/lib/browser/accounts/webSocketProgramAccountSubscriberV2.d.ts +53 -0
  4. package/lib/browser/accounts/webSocketProgramAccountSubscriberV2.js +453 -0
  5. package/lib/browser/addresses/pda.d.ts +9 -0
  6. package/lib/browser/addresses/pda.js +60 -1
  7. package/lib/browser/adminClient.d.ts +160 -8
  8. package/lib/browser/adminClient.js +754 -18
  9. package/lib/browser/constituentMap/constituentMap.d.ts +64 -0
  10. package/lib/browser/constituentMap/constituentMap.js +170 -0
  11. package/lib/browser/constituentMap/pollingConstituentAccountSubscriber.d.ts +24 -0
  12. package/lib/browser/constituentMap/pollingConstituentAccountSubscriber.js +60 -0
  13. package/lib/browser/constituentMap/webSocketConstituentAccountSubscriber.d.ts +24 -0
  14. package/lib/browser/constituentMap/webSocketConstituentAccountSubscriber.js +58 -0
  15. package/lib/browser/driftClient.d.ts +89 -2
  16. package/lib/browser/driftClient.js +486 -27
  17. package/lib/browser/driftClientConfig.d.ts +2 -7
  18. package/lib/browser/idl/drift.json +4303 -1379
  19. package/lib/browser/index.d.ts +1 -4
  20. package/lib/browser/index.js +2 -9
  21. package/lib/browser/memcmp.d.ts +3 -1
  22. package/lib/browser/memcmp.js +19 -1
  23. package/lib/browser/types.d.ts +147 -0
  24. package/lib/browser/types.js +13 -1
  25. package/lib/node/accounts/types.d.ts +13 -1
  26. package/lib/node/accounts/types.d.ts.map +1 -1
  27. package/lib/node/accounts/webSocketProgramAccountSubscriberV2.d.ts +54 -0
  28. package/lib/node/accounts/webSocketProgramAccountSubscriberV2.d.ts.map +1 -0
  29. package/lib/node/accounts/webSocketProgramAccountSubscriberV2.js +453 -0
  30. package/lib/node/addresses/pda.d.ts +9 -0
  31. package/lib/node/addresses/pda.d.ts.map +1 -1
  32. package/lib/node/addresses/pda.js +60 -1
  33. package/lib/node/adminClient.d.ts +160 -8
  34. package/lib/node/adminClient.d.ts.map +1 -1
  35. package/lib/node/adminClient.js +754 -18
  36. package/lib/node/constituentMap/constituentMap.d.ts +65 -0
  37. package/lib/node/constituentMap/constituentMap.d.ts.map +1 -0
  38. package/lib/node/constituentMap/constituentMap.js +170 -0
  39. package/lib/node/constituentMap/pollingConstituentAccountSubscriber.d.ts +25 -0
  40. package/lib/node/constituentMap/pollingConstituentAccountSubscriber.d.ts.map +1 -0
  41. package/lib/node/constituentMap/pollingConstituentAccountSubscriber.js +60 -0
  42. package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.d.ts +25 -0
  43. package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.d.ts.map +1 -0
  44. package/lib/node/constituentMap/webSocketConstituentAccountSubscriber.js +58 -0
  45. package/lib/node/driftClient.d.ts +89 -2
  46. package/lib/node/driftClient.d.ts.map +1 -1
  47. package/lib/node/driftClient.js +486 -27
  48. package/lib/node/driftClientConfig.d.ts +2 -7
  49. package/lib/node/driftClientConfig.d.ts.map +1 -1
  50. package/lib/node/idl/drift.json +4303 -1379
  51. package/lib/node/index.d.ts +1 -4
  52. package/lib/node/index.d.ts.map +1 -1
  53. package/lib/node/index.js +2 -9
  54. package/lib/node/memcmp.d.ts +3 -1
  55. package/lib/node/memcmp.d.ts.map +1 -1
  56. package/lib/node/memcmp.js +19 -1
  57. package/lib/node/types.d.ts +147 -0
  58. package/lib/node/types.d.ts.map +1 -1
  59. package/lib/node/types.js +13 -1
  60. package/package.json +1 -1
  61. package/src/accounts/types.ts +20 -0
  62. package/src/accounts/webSocketProgramAccountSubscriberV2.ts +596 -0
  63. package/src/addresses/pda.ts +115 -1
  64. package/src/adminClient.ts +1612 -41
  65. package/src/constituentMap/constituentMap.ts +285 -0
  66. package/src/constituentMap/pollingConstituentAccountSubscriber.ts +97 -0
  67. package/src/constituentMap/webSocketConstituentAccountSubscriber.ts +112 -0
  68. package/src/driftClient.ts +1097 -17
  69. package/src/driftClientConfig.ts +8 -15
  70. package/src/idl/drift.json +4303 -1379
  71. package/src/index.ts +1 -4
  72. package/src/memcmp.ts +23 -1
  73. package/src/types.ts +160 -0
@@ -5,7 +5,7 @@ import {
5
5
  PublicKey,
6
6
  TransactionVersion,
7
7
  } from '@solana/web3.js';
8
- import { IWallet, TxParams, UserAccount } from './types';
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
- /** If you use V2 here, whatever you pass for perpMarketAccountSubscriber and oracleAccountSubscriber will be ignored and it will use v2 under the hood regardless */
94
- driftClientAccountSubscriber?: new (
89
+ oracleAccountSubscriber?: new (
90
+ accountName: string,
95
91
  program: Program,
96
- perpMarketIndexes: number[],
97
- spotMarketIndexes: number[],
98
- oracleInfos: OracleInfo[],
99
- shouldFindAllMarketsAndOracles: boolean,
100
- delistedMarketSetting: DelistedMarketSetting
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';