@drift-labs/sdk 2.31.1-beta.9 → 2.32.0
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/constants/perpMarkets.js +20 -0
- package/lib/dlob/orderBookLevels.js +2 -2
- package/lib/driftClient.d.ts +51 -4
- package/lib/driftClient.js +195 -194
- package/lib/idl/drift.json +31 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -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/utils.d.ts +1 -0
- package/lib/math/utils.js +5 -1
- package/lib/orderParams.d.ts +18 -5
- package/lib/orderParams.js +17 -1
- package/lib/user.d.ts +45 -1
- package/lib/user.js +227 -9
- package/package.json +1 -1
- package/src/assert/assert.js +9 -0
- package/src/constants/perpMarkets.ts +20 -0
- package/src/dlob/orderBookLevels.ts +3 -2
- package/src/driftClient.ts +373 -223
- package/src/idl/drift.json +31 -1
- package/src/index.ts +3 -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/utils.ts +4 -0
- package/src/orderParams.ts +35 -5
- package/src/token/index.js +38 -0
- package/src/user.ts +453 -15
- package/src/util/computeUnits.js +27 -0
- package/src/util/promiseTimeout.js +14 -0
- package/src/util/tps.js +27 -0
- package/tests/spot/test.ts +156 -0
package/src/idl/drift.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.32.0",
|
|
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
|
@@ -17,6 +17,7 @@ export * from './accounts/pollingOracleAccountSubscriber';
|
|
|
17
17
|
export * from './accounts/pollingTokenAccountSubscriber';
|
|
18
18
|
export * from './accounts/pollingUserAccountSubscriber';
|
|
19
19
|
export * from './accounts/pollingUserStatsAccountSubscriber';
|
|
20
|
+
export * from './accounts/mockUserAccountSubscriber';
|
|
20
21
|
export * from './accounts/types';
|
|
21
22
|
export * from './addresses/pda';
|
|
22
23
|
export * from './adminClient';
|
|
@@ -46,6 +47,8 @@ export * from './math/orders';
|
|
|
46
47
|
export * from './math/repeg';
|
|
47
48
|
export * from './math/margin';
|
|
48
49
|
export * from './math/insurance';
|
|
50
|
+
export * from './math/superStake';
|
|
51
|
+
export * from './marinade';
|
|
49
52
|
export * from './orderParams';
|
|
50
53
|
export * from './slot/SlotSubscriber';
|
|
51
54
|
export * from './wallet';
|