@drift-labs/sdk 2.146.0-beta.9 → 2.147.0-beta.1
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/grpcMultiUserAccountSubscriber.js +8 -1
- package/lib/browser/adminClient.d.ts +3 -3
- package/lib/browser/adminClient.js +13 -17
- package/lib/browser/constants/numericConstants.d.ts +2 -0
- package/lib/browser/constants/numericConstants.js +5 -1
- package/lib/browser/constants/perpMarkets.d.ts +2 -1
- package/lib/browser/constants/perpMarkets.js +31 -1
- package/lib/browser/constants/spotMarkets.d.ts +2 -0
- package/lib/browser/constants/spotMarkets.js +21 -14
- package/lib/browser/driftClient.d.ts +22 -12
- package/lib/browser/driftClient.js +37 -25
- package/lib/browser/idl/drift.json +38 -251
- package/lib/browser/math/superStake.d.ts +1 -1
- package/lib/browser/math/superStake.js +1 -1
- package/lib/browser/swap/UnifiedSwapClient.d.ts +28 -3
- package/lib/browser/swap/UnifiedSwapClient.js +2 -2
- package/lib/browser/types.d.ts +3 -1
- package/lib/browser/types.js +1 -0
- package/lib/node/accounts/grpcMultiUserAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcMultiUserAccountSubscriber.js +8 -1
- package/lib/node/adminClient.d.ts +3 -3
- package/lib/node/adminClient.d.ts.map +1 -1
- package/lib/node/adminClient.js +13 -17
- package/lib/node/constants/numericConstants.d.ts +2 -0
- package/lib/node/constants/numericConstants.d.ts.map +1 -1
- package/lib/node/constants/numericConstants.js +5 -1
- package/lib/node/constants/perpMarkets.d.ts +2 -1
- package/lib/node/constants/perpMarkets.d.ts.map +1 -1
- package/lib/node/constants/perpMarkets.js +31 -1
- package/lib/node/constants/spotMarkets.d.ts +2 -0
- package/lib/node/constants/spotMarkets.d.ts.map +1 -1
- package/lib/node/constants/spotMarkets.js +21 -14
- package/lib/node/driftClient.d.ts +22 -12
- package/lib/node/driftClient.d.ts.map +1 -1
- package/lib/node/driftClient.js +37 -25
- package/lib/node/idl/drift.json +38 -251
- package/lib/node/math/superStake.d.ts +1 -1
- package/lib/node/math/superStake.js +1 -1
- package/lib/node/swap/UnifiedSwapClient.d.ts +28 -3
- package/lib/node/swap/UnifiedSwapClient.d.ts.map +1 -1
- package/lib/node/swap/UnifiedSwapClient.js +2 -2
- package/lib/node/types.d.ts +3 -1
- package/lib/node/types.d.ts.map +1 -1
- package/lib/node/types.js +1 -0
- package/package.json +1 -1
- package/src/accounts/grpcMultiUserAccountSubscriber.ts +8 -1
- package/src/adminClient.ts +28 -30
- package/src/constants/numericConstants.ts +5 -0
- package/src/constants/perpMarkets.ts +33 -3
- package/src/constants/spotMarkets.ts +23 -14
- package/src/driftClient.ts +65 -36
- package/src/idl/drift.json +39 -252
- package/src/math/superStake.ts +1 -1
- package/src/swap/UnifiedSwapClient.ts +25 -3
- package/src/types.ts +2 -0
- package/tests/dlob/helpers.ts +3 -3
package/lib/node/idl/drift.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.146.0",
|
|
3
3
|
"name": "drift",
|
|
4
4
|
"instructions": [
|
|
5
5
|
{
|
|
@@ -2020,32 +2020,6 @@
|
|
|
2020
2020
|
}
|
|
2021
2021
|
]
|
|
2022
2022
|
},
|
|
2023
|
-
{
|
|
2024
|
-
"name": "updateUserFuelBonus",
|
|
2025
|
-
"accounts": [
|
|
2026
|
-
{
|
|
2027
|
-
"name": "state",
|
|
2028
|
-
"isMut": false,
|
|
2029
|
-
"isSigner": false
|
|
2030
|
-
},
|
|
2031
|
-
{
|
|
2032
|
-
"name": "authority",
|
|
2033
|
-
"isMut": false,
|
|
2034
|
-
"isSigner": true
|
|
2035
|
-
},
|
|
2036
|
-
{
|
|
2037
|
-
"name": "user",
|
|
2038
|
-
"isMut": true,
|
|
2039
|
-
"isSigner": false
|
|
2040
|
-
},
|
|
2041
|
-
{
|
|
2042
|
-
"name": "userStats",
|
|
2043
|
-
"isMut": true,
|
|
2044
|
-
"isSigner": false
|
|
2045
|
-
}
|
|
2046
|
-
],
|
|
2047
|
-
"args": []
|
|
2048
|
-
},
|
|
2049
2023
|
{
|
|
2050
2024
|
"name": "updateUserStatsReferrerStatus",
|
|
2051
2025
|
"accounts": [
|
|
@@ -4285,11 +4259,6 @@
|
|
|
4285
4259
|
"isMut": true,
|
|
4286
4260
|
"isSigner": false
|
|
4287
4261
|
},
|
|
4288
|
-
{
|
|
4289
|
-
"name": "ammCache",
|
|
4290
|
-
"isMut": true,
|
|
4291
|
-
"isSigner": false
|
|
4292
|
-
},
|
|
4293
4262
|
{
|
|
4294
4263
|
"name": "oracle",
|
|
4295
4264
|
"isMut": false,
|
|
@@ -4454,7 +4423,7 @@
|
|
|
4454
4423
|
"args": []
|
|
4455
4424
|
},
|
|
4456
4425
|
{
|
|
4457
|
-
"name": "
|
|
4426
|
+
"name": "addMarketToAmmCache",
|
|
4458
4427
|
"accounts": [
|
|
4459
4428
|
{
|
|
4460
4429
|
"name": "admin",
|
|
@@ -4471,6 +4440,11 @@
|
|
|
4471
4440
|
"isMut": true,
|
|
4472
4441
|
"isSigner": false
|
|
4473
4442
|
},
|
|
4443
|
+
{
|
|
4444
|
+
"name": "perpMarket",
|
|
4445
|
+
"isMut": false,
|
|
4446
|
+
"isSigner": false
|
|
4447
|
+
},
|
|
4474
4448
|
{
|
|
4475
4449
|
"name": "rent",
|
|
4476
4450
|
"isMut": false,
|
|
@@ -4484,6 +4458,27 @@
|
|
|
4484
4458
|
],
|
|
4485
4459
|
"args": []
|
|
4486
4460
|
},
|
|
4461
|
+
{
|
|
4462
|
+
"name": "deleteAmmCache",
|
|
4463
|
+
"accounts": [
|
|
4464
|
+
{
|
|
4465
|
+
"name": "admin",
|
|
4466
|
+
"isMut": true,
|
|
4467
|
+
"isSigner": true
|
|
4468
|
+
},
|
|
4469
|
+
{
|
|
4470
|
+
"name": "state",
|
|
4471
|
+
"isMut": false,
|
|
4472
|
+
"isSigner": false
|
|
4473
|
+
},
|
|
4474
|
+
{
|
|
4475
|
+
"name": "ammCache",
|
|
4476
|
+
"isMut": true,
|
|
4477
|
+
"isSigner": false
|
|
4478
|
+
}
|
|
4479
|
+
],
|
|
4480
|
+
"args": []
|
|
4481
|
+
},
|
|
4487
4482
|
{
|
|
4488
4483
|
"name": "updateInitialAmmCacheInfo",
|
|
4489
4484
|
"accounts": [
|
|
@@ -6109,27 +6104,6 @@
|
|
|
6109
6104
|
}
|
|
6110
6105
|
]
|
|
6111
6106
|
},
|
|
6112
|
-
{
|
|
6113
|
-
"name": "updateLpCooldownTime",
|
|
6114
|
-
"accounts": [
|
|
6115
|
-
{
|
|
6116
|
-
"name": "admin",
|
|
6117
|
-
"isMut": false,
|
|
6118
|
-
"isSigner": true
|
|
6119
|
-
},
|
|
6120
|
-
{
|
|
6121
|
-
"name": "state",
|
|
6122
|
-
"isMut": true,
|
|
6123
|
-
"isSigner": false
|
|
6124
|
-
}
|
|
6125
|
-
],
|
|
6126
|
-
"args": [
|
|
6127
|
-
{
|
|
6128
|
-
"name": "lpCooldownTime",
|
|
6129
|
-
"type": "u64"
|
|
6130
|
-
}
|
|
6131
|
-
]
|
|
6132
|
-
},
|
|
6133
6107
|
{
|
|
6134
6108
|
"name": "updatePerpFeeStructure",
|
|
6135
6109
|
"accounts": [
|
|
@@ -6705,46 +6679,6 @@
|
|
|
6705
6679
|
}
|
|
6706
6680
|
]
|
|
6707
6681
|
},
|
|
6708
|
-
{
|
|
6709
|
-
"name": "updatePerpMarketFuel",
|
|
6710
|
-
"accounts": [
|
|
6711
|
-
{
|
|
6712
|
-
"name": "admin",
|
|
6713
|
-
"isMut": false,
|
|
6714
|
-
"isSigner": true
|
|
6715
|
-
},
|
|
6716
|
-
{
|
|
6717
|
-
"name": "state",
|
|
6718
|
-
"isMut": false,
|
|
6719
|
-
"isSigner": false
|
|
6720
|
-
},
|
|
6721
|
-
{
|
|
6722
|
-
"name": "perpMarket",
|
|
6723
|
-
"isMut": true,
|
|
6724
|
-
"isSigner": false
|
|
6725
|
-
}
|
|
6726
|
-
],
|
|
6727
|
-
"args": [
|
|
6728
|
-
{
|
|
6729
|
-
"name": "fuelBoostTaker",
|
|
6730
|
-
"type": {
|
|
6731
|
-
"option": "u8"
|
|
6732
|
-
}
|
|
6733
|
-
},
|
|
6734
|
-
{
|
|
6735
|
-
"name": "fuelBoostMaker",
|
|
6736
|
-
"type": {
|
|
6737
|
-
"option": "u8"
|
|
6738
|
-
}
|
|
6739
|
-
},
|
|
6740
|
-
{
|
|
6741
|
-
"name": "fuelBoostPosition",
|
|
6742
|
-
"type": {
|
|
6743
|
-
"option": "u8"
|
|
6744
|
-
}
|
|
6745
|
-
}
|
|
6746
|
-
]
|
|
6747
|
-
},
|
|
6748
6682
|
{
|
|
6749
6683
|
"name": "updatePerpMarketProtectedMakerParams",
|
|
6750
6684
|
"accounts": [
|
|
@@ -6865,115 +6799,6 @@
|
|
|
6865
6799
|
}
|
|
6866
6800
|
]
|
|
6867
6801
|
},
|
|
6868
|
-
{
|
|
6869
|
-
"name": "updateSpotMarketFuel",
|
|
6870
|
-
"accounts": [
|
|
6871
|
-
{
|
|
6872
|
-
"name": "admin",
|
|
6873
|
-
"isMut": false,
|
|
6874
|
-
"isSigner": true
|
|
6875
|
-
},
|
|
6876
|
-
{
|
|
6877
|
-
"name": "state",
|
|
6878
|
-
"isMut": false,
|
|
6879
|
-
"isSigner": false
|
|
6880
|
-
},
|
|
6881
|
-
{
|
|
6882
|
-
"name": "spotMarket",
|
|
6883
|
-
"isMut": true,
|
|
6884
|
-
"isSigner": false
|
|
6885
|
-
}
|
|
6886
|
-
],
|
|
6887
|
-
"args": [
|
|
6888
|
-
{
|
|
6889
|
-
"name": "fuelBoostDeposits",
|
|
6890
|
-
"type": {
|
|
6891
|
-
"option": "u8"
|
|
6892
|
-
}
|
|
6893
|
-
},
|
|
6894
|
-
{
|
|
6895
|
-
"name": "fuelBoostBorrows",
|
|
6896
|
-
"type": {
|
|
6897
|
-
"option": "u8"
|
|
6898
|
-
}
|
|
6899
|
-
},
|
|
6900
|
-
{
|
|
6901
|
-
"name": "fuelBoostTaker",
|
|
6902
|
-
"type": {
|
|
6903
|
-
"option": "u8"
|
|
6904
|
-
}
|
|
6905
|
-
},
|
|
6906
|
-
{
|
|
6907
|
-
"name": "fuelBoostMaker",
|
|
6908
|
-
"type": {
|
|
6909
|
-
"option": "u8"
|
|
6910
|
-
}
|
|
6911
|
-
},
|
|
6912
|
-
{
|
|
6913
|
-
"name": "fuelBoostInsurance",
|
|
6914
|
-
"type": {
|
|
6915
|
-
"option": "u8"
|
|
6916
|
-
}
|
|
6917
|
-
}
|
|
6918
|
-
]
|
|
6919
|
-
},
|
|
6920
|
-
{
|
|
6921
|
-
"name": "initUserFuel",
|
|
6922
|
-
"accounts": [
|
|
6923
|
-
{
|
|
6924
|
-
"name": "admin",
|
|
6925
|
-
"isMut": false,
|
|
6926
|
-
"isSigner": true
|
|
6927
|
-
},
|
|
6928
|
-
{
|
|
6929
|
-
"name": "state",
|
|
6930
|
-
"isMut": false,
|
|
6931
|
-
"isSigner": false
|
|
6932
|
-
},
|
|
6933
|
-
{
|
|
6934
|
-
"name": "user",
|
|
6935
|
-
"isMut": true,
|
|
6936
|
-
"isSigner": false
|
|
6937
|
-
},
|
|
6938
|
-
{
|
|
6939
|
-
"name": "userStats",
|
|
6940
|
-
"isMut": true,
|
|
6941
|
-
"isSigner": false
|
|
6942
|
-
}
|
|
6943
|
-
],
|
|
6944
|
-
"args": [
|
|
6945
|
-
{
|
|
6946
|
-
"name": "fuelBoostDeposits",
|
|
6947
|
-
"type": {
|
|
6948
|
-
"option": "i32"
|
|
6949
|
-
}
|
|
6950
|
-
},
|
|
6951
|
-
{
|
|
6952
|
-
"name": "fuelBoostBorrows",
|
|
6953
|
-
"type": {
|
|
6954
|
-
"option": "u32"
|
|
6955
|
-
}
|
|
6956
|
-
},
|
|
6957
|
-
{
|
|
6958
|
-
"name": "fuelBoostTaker",
|
|
6959
|
-
"type": {
|
|
6960
|
-
"option": "u32"
|
|
6961
|
-
}
|
|
6962
|
-
},
|
|
6963
|
-
{
|
|
6964
|
-
"name": "fuelBoostMaker",
|
|
6965
|
-
"type": {
|
|
6966
|
-
"option": "u32"
|
|
6967
|
-
}
|
|
6968
|
-
},
|
|
6969
|
-
{
|
|
6970
|
-
"name": "fuelBoostInsurance",
|
|
6971
|
-
"type": {
|
|
6972
|
-
"option": "u32"
|
|
6973
|
-
}
|
|
6974
|
-
}
|
|
6975
|
-
]
|
|
6976
|
-
},
|
|
6977
6802
|
{
|
|
6978
6803
|
"name": "updateAdmin",
|
|
6979
6804
|
"accounts": [
|
|
@@ -6995,27 +6820,6 @@
|
|
|
6995
6820
|
}
|
|
6996
6821
|
]
|
|
6997
6822
|
},
|
|
6998
|
-
{
|
|
6999
|
-
"name": "updateWhitelistMint",
|
|
7000
|
-
"accounts": [
|
|
7001
|
-
{
|
|
7002
|
-
"name": "admin",
|
|
7003
|
-
"isMut": false,
|
|
7004
|
-
"isSigner": true
|
|
7005
|
-
},
|
|
7006
|
-
{
|
|
7007
|
-
"name": "state",
|
|
7008
|
-
"isMut": true,
|
|
7009
|
-
"isSigner": false
|
|
7010
|
-
}
|
|
7011
|
-
],
|
|
7012
|
-
"args": [
|
|
7013
|
-
{
|
|
7014
|
-
"name": "whitelistMint",
|
|
7015
|
-
"type": "publicKey"
|
|
7016
|
-
}
|
|
7017
|
-
]
|
|
7018
|
-
},
|
|
7019
6823
|
{
|
|
7020
6824
|
"name": "updateDiscountMint",
|
|
7021
6825
|
"accounts": [
|
|
@@ -8478,32 +8282,6 @@
|
|
|
8478
8282
|
}
|
|
8479
8283
|
]
|
|
8480
8284
|
},
|
|
8481
|
-
{
|
|
8482
|
-
"name": "resetAmmCache",
|
|
8483
|
-
"accounts": [
|
|
8484
|
-
{
|
|
8485
|
-
"name": "admin",
|
|
8486
|
-
"isMut": true,
|
|
8487
|
-
"isSigner": true
|
|
8488
|
-
},
|
|
8489
|
-
{
|
|
8490
|
-
"name": "state",
|
|
8491
|
-
"isMut": false,
|
|
8492
|
-
"isSigner": false
|
|
8493
|
-
},
|
|
8494
|
-
{
|
|
8495
|
-
"name": "ammCache",
|
|
8496
|
-
"isMut": true,
|
|
8497
|
-
"isSigner": false
|
|
8498
|
-
},
|
|
8499
|
-
{
|
|
8500
|
-
"name": "systemProgram",
|
|
8501
|
-
"isMut": false,
|
|
8502
|
-
"isSigner": false
|
|
8503
|
-
}
|
|
8504
|
-
],
|
|
8505
|
-
"args": []
|
|
8506
|
-
},
|
|
8507
8285
|
{
|
|
8508
8286
|
"name": "lpPoolSwap",
|
|
8509
8287
|
"accounts": [
|
|
@@ -12267,6 +12045,10 @@
|
|
|
12267
12045
|
"name": "oracleSlot",
|
|
12268
12046
|
"type": "u64"
|
|
12269
12047
|
},
|
|
12048
|
+
{
|
|
12049
|
+
"name": "marketIndex",
|
|
12050
|
+
"type": "u16"
|
|
12051
|
+
},
|
|
12270
12052
|
{
|
|
12271
12053
|
"name": "oracleSource",
|
|
12272
12054
|
"type": "u8"
|
|
@@ -12288,7 +12070,7 @@
|
|
|
12288
12070
|
"type": {
|
|
12289
12071
|
"array": [
|
|
12290
12072
|
"u8",
|
|
12291
|
-
|
|
12073
|
+
34
|
|
12292
12074
|
]
|
|
12293
12075
|
}
|
|
12294
12076
|
}
|
|
@@ -19777,6 +19559,11 @@
|
|
|
19777
19559
|
"code": 6343,
|
|
19778
19560
|
"name": "InvalidLpPoolId",
|
|
19779
19561
|
"msg": "Invalid Lp Pool Id for Operation"
|
|
19562
|
+
},
|
|
19563
|
+
{
|
|
19564
|
+
"code": 6344,
|
|
19565
|
+
"name": "MarketIndexNotFoundAmmCache",
|
|
19566
|
+
"msg": "MarketIndexNotFoundAmmCache"
|
|
19780
19567
|
}
|
|
19781
19568
|
]
|
|
19782
19569
|
}
|
|
@@ -74,7 +74,7 @@ export declare function findBestJitoSolSuperStakeIxs({ amount, jupiterClient, dr
|
|
|
74
74
|
price?: number;
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
77
|
-
* Finds best
|
|
77
|
+
* Finds best swap instructions for a generic lstMint
|
|
78
78
|
*
|
|
79
79
|
* Without doing any extra steps like checking if you can get a better rate by staking directly with that LST platform
|
|
80
80
|
*/
|
|
@@ -129,7 +129,7 @@ async function findBestJitoSolSuperStakeIxs({ amount, jupiterClient, driftClient
|
|
|
129
129
|
}
|
|
130
130
|
exports.findBestJitoSolSuperStakeIxs = findBestJitoSolSuperStakeIxs;
|
|
131
131
|
/**
|
|
132
|
-
* Finds best
|
|
132
|
+
* Finds best swap instructions for a generic lstMint
|
|
133
133
|
*
|
|
134
134
|
* Without doing any extra steps like checking if you can get a better rate by staking directly with that LST platform
|
|
135
135
|
*/
|
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
import { Connection, PublicKey, TransactionMessage, AddressLookupTableAccount, VersionedTransaction, TransactionInstruction } from '@solana/web3.js';
|
|
3
3
|
import { BN } from '@coral-xyz/anchor';
|
|
4
|
-
import { JupiterClient
|
|
5
|
-
import { TitanClient
|
|
4
|
+
import { JupiterClient } from '../jupiter/jupiterClient';
|
|
5
|
+
import { TitanClient } from '../titan/titanClient';
|
|
6
6
|
export type SwapMode = 'ExactIn' | 'ExactOut';
|
|
7
7
|
export type SwapClientType = 'jupiter' | 'titan';
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Unified quote response interface that combines properties from both Jupiter and Titan
|
|
10
|
+
* This provides a consistent interface while allowing for provider-specific fields
|
|
11
|
+
*/
|
|
12
|
+
export interface UnifiedQuoteResponse {
|
|
13
|
+
inputMint: string;
|
|
14
|
+
inAmount: string;
|
|
15
|
+
outputMint: string;
|
|
16
|
+
outAmount: string;
|
|
17
|
+
swapMode: SwapMode;
|
|
18
|
+
slippageBps: number;
|
|
19
|
+
routePlan: Array<{
|
|
20
|
+
swapInfo: any;
|
|
21
|
+
percent: number;
|
|
22
|
+
}>;
|
|
23
|
+
otherAmountThreshold?: string;
|
|
24
|
+
priceImpactPct?: string;
|
|
25
|
+
platformFee?: {
|
|
26
|
+
amount?: string;
|
|
27
|
+
feeBps?: number;
|
|
28
|
+
};
|
|
29
|
+
contextSlot?: number;
|
|
30
|
+
timeTaken?: number;
|
|
31
|
+
error?: string;
|
|
32
|
+
errorCode?: string;
|
|
33
|
+
}
|
|
9
34
|
export interface SwapQuoteParams {
|
|
10
35
|
inputMint: PublicKey;
|
|
11
36
|
outputMint: PublicKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnifiedSwapClient.d.ts","sourceRoot":"","sources":["../../../src/swap/UnifiedSwapClient.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EACN,aAAa,
|
|
1
|
+
{"version":3,"file":"UnifiedSwapClient.d.ts","sourceRoot":"","sources":["../../../src/swap/UnifiedSwapClient.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EACN,aAAa,EAEb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,WAAW,EAGX,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAC9C,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IAEpC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC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AW;IAI/C;;OAEG;IACI,aAAa,IAAI,cAAc;IAItC;;OAEG;IACI,SAAS,IAAI,OAAO;IAI3B;;OAEG;IACI,OAAO,IAAI,OAAO;CAGzB"}
|
|
@@ -61,7 +61,7 @@ class UnifiedSwapClient {
|
|
|
61
61
|
async getSwap(params) {
|
|
62
62
|
if (this.clientType === 'jupiter') {
|
|
63
63
|
const jupiterClient = this.client;
|
|
64
|
-
// Cast the quote to Jupiter's QuoteResponse type
|
|
64
|
+
// Cast the quote to Jupiter's specific QuoteResponse type
|
|
65
65
|
const jupiterParams = {
|
|
66
66
|
...params,
|
|
67
67
|
quote: params.quote,
|
|
@@ -111,7 +111,7 @@ class UnifiedSwapClient {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
if (!finalQuote) {
|
|
114
|
-
throw new Error(
|
|
114
|
+
throw new Error('Could not fetch swap quote. Please try again.');
|
|
115
115
|
}
|
|
116
116
|
// Get swap transaction and extract instructions
|
|
117
117
|
const transaction = await jupiterClient.getSwap({
|
package/lib/node/types.d.ts
CHANGED
|
@@ -59,7 +59,8 @@ export declare enum PerpOperation {
|
|
|
59
59
|
FILL = 4,
|
|
60
60
|
SETTLE_PNL = 8,
|
|
61
61
|
SETTLE_PNL_WITH_POSITION = 16,
|
|
62
|
-
LIQUIDATION = 32
|
|
62
|
+
LIQUIDATION = 32,
|
|
63
|
+
SETTLE_REV_POOL = 64
|
|
63
64
|
}
|
|
64
65
|
export declare enum SpotOperation {
|
|
65
66
|
UPDATE_CUMULATIVE_INTEREST = 1,
|
|
@@ -1854,6 +1855,7 @@ export type CacheInfo = {
|
|
|
1854
1855
|
oracleValidity: number;
|
|
1855
1856
|
lpStatusForPerpMarket: number;
|
|
1856
1857
|
ammPositionScalar: number;
|
|
1858
|
+
marketIndex: number;
|
|
1857
1859
|
};
|
|
1858
1860
|
export type AmmCache = {
|
|
1859
1861
|
cache: CacheInfo[];
|