@drift-labs/sdk 2.31.1-beta.2 → 2.31.1-beta.21
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/accounts/mockUserAccountSubscriber.d.ts +23 -0
- package/lib/accounts/mockUserAccountSubscriber.js +31 -0
- package/lib/constants/perpMarkets.js +20 -0
- package/lib/dlob/orderBookLevels.js +2 -2
- package/lib/driftClient.d.ts +57 -4
- package/lib/driftClient.js +244 -205
- package/lib/driftClientConfig.d.ts +2 -1
- package/lib/idl/drift.json +31 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/marinade/index.d.ts +11 -0
- package/lib/marinade/index.js +36 -0
- package/lib/marinade/types.d.ts +1963 -0
- package/lib/marinade/types.js +1965 -0
- package/lib/math/spotBalance.d.ts +9 -2
- package/lib/math/spotBalance.js +54 -6
- package/lib/math/superStake.d.ts +22 -0
- package/lib/math/superStake.js +108 -0
- package/lib/math/tiers.d.ts +4 -0
- package/lib/math/tiers.js +52 -0
- package/lib/tx/retryTxSender.d.ts +12 -3
- package/lib/tx/retryTxSender.js +22 -22
- package/lib/tx/types.d.ts +2 -2
- package/lib/user.d.ts +10 -1
- package/lib/user.js +39 -8
- package/lib/userConfig.d.ts +4 -0
- package/lib/userStats.js +4 -1
- package/lib/userStatsConfig.d.ts +2 -0
- package/package.json +1 -1
- package/src/accounts/mockUserAccountSubscriber.ts +53 -0
- package/src/config.ts +2 -2
- package/src/constants/perpMarkets.ts +20 -0
- package/src/dlob/orderBookLevels.ts +3 -2
- package/src/driftClient.ts +440 -224
- package/src/driftClientConfig.ts +2 -1
- package/src/idl/drift.json +31 -1
- package/src/index.ts +2 -0
- package/src/marinade/idl/idl.json +1962 -0
- package/src/marinade/index.ts +64 -0
- package/src/marinade/types.ts +3925 -0
- package/src/math/spotBalance.ts +83 -5
- package/src/math/superStake.ts +148 -0
- package/src/math/tiers.ts +44 -0
- package/src/tx/retryTxSender.ts +39 -35
- package/src/tx/types.ts +2 -2
- package/src/user.ts +63 -12
- package/src/userConfig.ts +5 -0
- package/src/userStats.ts +4 -0
- package/src/userStatsConfig.ts +3 -0
- package/tests/spot/test.ts +156 -0
package/src/driftClientConfig.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
PublicKey,
|
|
5
5
|
TransactionVersion,
|
|
6
6
|
} from '@solana/web3.js';
|
|
7
|
-
import { IWallet } from './types';
|
|
7
|
+
import { IWallet, TxParams } from './types';
|
|
8
8
|
import { OracleInfo } from './oracles/types';
|
|
9
9
|
import { BulkAccountLoader } from './accounts/bulkAccountLoader';
|
|
10
10
|
import { DriftEnv } from './config';
|
|
@@ -30,6 +30,7 @@ export type DriftClientConfig = {
|
|
|
30
30
|
authoritySubAccountMap?: Map<string, number[]>; // if passed this will override subAccountIds and includeDelegates
|
|
31
31
|
skipLoadUsers?: boolean; // if passed to constructor, no user accounts will be loaded. they will load if updateWallet is called afterwards.
|
|
32
32
|
txVersion?: TransactionVersion; // which tx version to use
|
|
33
|
+
txParams?: TxParams; // default tx params to use
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
export type DriftClientSubscriptionConfig =
|
package/src/idl/drift.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.31.1-beta.
|
|
2
|
+
"version": "2.31.1-beta.21",
|
|
3
3
|
"name": "drift",
|
|
4
4
|
"instructions": [
|
|
5
5
|
{
|
|
@@ -710,6 +710,36 @@
|
|
|
710
710
|
}
|
|
711
711
|
]
|
|
712
712
|
},
|
|
713
|
+
{
|
|
714
|
+
"name": "placeOrders",
|
|
715
|
+
"accounts": [
|
|
716
|
+
{
|
|
717
|
+
"name": "state",
|
|
718
|
+
"isMut": false,
|
|
719
|
+
"isSigner": false
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"name": "user",
|
|
723
|
+
"isMut": true,
|
|
724
|
+
"isSigner": false
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"name": "authority",
|
|
728
|
+
"isMut": false,
|
|
729
|
+
"isSigner": true
|
|
730
|
+
}
|
|
731
|
+
],
|
|
732
|
+
"args": [
|
|
733
|
+
{
|
|
734
|
+
"name": "params",
|
|
735
|
+
"type": {
|
|
736
|
+
"vec": {
|
|
737
|
+
"defined": "OrderParams"
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
]
|
|
742
|
+
},
|
|
713
743
|
{
|
|
714
744
|
"name": "beginSwap",
|
|
715
745
|
"accounts": [
|
package/src/index.ts
CHANGED
|
@@ -46,6 +46,8 @@ export * from './math/orders';
|
|
|
46
46
|
export * from './math/repeg';
|
|
47
47
|
export * from './math/margin';
|
|
48
48
|
export * from './math/insurance';
|
|
49
|
+
export * from './math/superStake';
|
|
50
|
+
export * from './marinade';
|
|
49
51
|
export * from './orderParams';
|
|
50
52
|
export * from './slot/SlotSubscriber';
|
|
51
53
|
export * from './wallet';
|