@drift-labs/sdk 2.24.0 → 2.25.0-beta.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/README.md +1 -1
- package/lib/accounts/fetch.d.ts +1 -1
- package/lib/accounts/pollingDriftClientAccountSubscriber.d.ts +1 -1
- package/lib/accounts/pollingOracleAccountSubscriber.d.ts +1 -1
- package/lib/accounts/pollingTokenAccountSubscriber.d.ts +1 -1
- package/lib/accounts/pollingUserAccountSubscriber.d.ts +1 -1
- package/lib/accounts/pollingUserStatsAccountSubscriber.d.ts +1 -1
- package/lib/accounts/webSocketAccountSubscriber.d.ts +1 -1
- package/lib/accounts/webSocketDriftClientAccountSubscriber.d.ts +1 -1
- package/lib/accounts/webSocketUserAccountSubscriber.d.ts +1 -1
- package/lib/accounts/webSocketUserStatsAccountSubsriber.d.ts +1 -1
- package/lib/addresses/pda.d.ts +1 -2
- package/lib/addresses/pda.js +1 -1
- package/lib/adminClient.d.ts +1 -2
- package/lib/adminClient.js +2 -2
- package/lib/constants/numericConstants.d.ts +59 -61
- package/lib/constants/spotMarkets.d.ts +0 -1
- package/lib/dlob/DLOB.d.ts +0 -1
- package/lib/dlob/DLOBNode.d.ts +0 -1
- package/lib/dlob/DLOBOrders.d.ts +1 -1
- package/lib/dlob/DLOBOrders.js +1 -1
- package/lib/dlob/NodeList.d.ts +0 -1
- package/lib/driftClient.d.ts +38 -23
- package/lib/driftClient.js +85 -131
- package/lib/events/eventSubscriber.d.ts +1 -1
- package/lib/events/eventSubscriber.js +3 -2
- package/lib/events/fetchLogs.d.ts +1 -1
- package/lib/events/fetchLogs.js +3 -2
- package/lib/examples/loadDlob.js +1 -1
- package/lib/examples/makeTradeExample.js +1 -1
- package/lib/factory/bigNum.d.ts +8 -9
- package/lib/factory/bigNum.js +1 -1
- package/lib/factory/oracleClient.js +1 -1
- package/lib/idl/drift.json +181 -14
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/math/amm.d.ts +2 -3
- package/lib/math/amm.js +1 -1
- package/lib/math/auction.d.ts +0 -1
- package/lib/math/conversion.d.ts +1 -2
- package/lib/math/funding.d.ts +1 -2
- package/lib/math/funding.js +1 -1
- package/lib/math/insurance.d.ts +1 -1
- package/lib/math/insurance.js +17 -1
- package/lib/math/margin.d.ts +1 -2
- package/lib/math/margin.js +1 -1
- package/lib/math/market.d.ts +1 -2
- package/lib/math/market.js +1 -1
- package/lib/math/oracles.d.ts +0 -1
- package/lib/math/oracles.js +2 -3
- package/lib/math/orders.d.ts +1 -2
- package/lib/math/orders.js +1 -1
- package/lib/math/position.d.ts +0 -1
- package/lib/math/repeg.d.ts +1 -2
- package/lib/math/repeg.js +1 -1
- package/lib/math/spotBalance.d.ts +1 -2
- package/lib/math/spotBalance.js +1 -1
- package/lib/math/spotMarket.d.ts +1 -2
- package/lib/math/spotMarket.js +1 -1
- package/lib/math/spotPosition.d.ts +1 -2
- package/lib/math/trade.d.ts +1 -2
- package/lib/math/trade.js +1 -1
- package/lib/math/utils.d.ts +0 -1
- package/lib/oracles/pythClient.d.ts +2 -3
- package/lib/oracles/pythClient.js +1 -1
- package/lib/oracles/quoteAssetOracleClient.js +1 -1
- package/lib/oracles/types.d.ts +1 -2
- package/lib/orderParams.d.ts +1 -2
- package/lib/serum/serumSubscriber.d.ts +1 -2
- package/lib/serum/serumSubscriber.js +1 -1
- package/lib/tokenFaucet.d.ts +2 -3
- package/lib/tokenFaucet.js +2 -2
- package/lib/tx/retryTxSender.d.ts +1 -1
- package/lib/tx/types.d.ts +1 -1
- package/lib/types.d.ts +8 -3
- package/lib/types.js +2 -1
- package/lib/user.d.ts +0 -1
- package/package.json +2 -2
- package/src/accounts/fetch.ts +1 -1
- package/src/accounts/pollingDriftClientAccountSubscriber.ts +1 -1
- package/src/accounts/pollingOracleAccountSubscriber.ts +1 -1
- package/src/accounts/pollingTokenAccountSubscriber.ts +1 -1
- package/src/accounts/pollingUserAccountSubscriber.ts +1 -1
- package/src/accounts/pollingUserStatsAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketDriftClientAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketUserAccountSubscriber.ts +1 -1
- package/src/accounts/webSocketUserStatsAccountSubsriber.ts +1 -1
- package/src/addresses/pda.ts +2 -2
- package/src/adminClient.ts +2 -2
- package/src/dlob/DLOBOrders.ts +2 -2
- package/src/driftClient.ts +136 -153
- package/src/events/eventSubscriber.ts +7 -3
- package/src/events/fetchLogs.ts +7 -3
- package/src/examples/loadDlob.ts +1 -1
- package/src/examples/makeTradeExample.ts +1 -1
- package/src/factory/bigNum.ts +1 -1
- package/src/factory/oracleClient.ts +1 -1
- package/src/idl/drift.json +181 -14
- package/src/index.ts +1 -1
- package/src/math/amm.ts +1 -1
- package/src/math/funding.ts +1 -1
- package/src/math/insurance.ts +29 -0
- package/src/math/margin.ts +1 -1
- package/src/math/market.ts +1 -1
- package/src/math/oracles.ts +2 -3
- package/src/math/orders.ts +1 -1
- package/src/math/repeg.ts +1 -1
- package/src/math/spotBalance.ts +1 -1
- package/src/math/spotMarket.ts +1 -1
- package/src/math/spotPosition.ts +1 -1
- package/src/math/trade.ts +1 -1
- package/src/oracles/pythClient.ts +1 -1
- package/src/oracles/quoteAssetOracleClient.ts +1 -1
- package/src/oracles/types.ts +1 -1
- package/src/orderParams.ts +1 -1
- package/src/serum/serumSubscriber.ts +1 -1
- package/src/tokenFaucet.ts +2 -2
- package/src/tx/retryTxSender.ts +1 -1
- package/src/tx/types.ts +1 -1
- package/src/types.ts +6 -1
- package/src/userMap/userStatsMap.ts +1 -1
package/src/idl/drift.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.25.0-beta.0",
|
|
3
3
|
"name": "drift",
|
|
4
4
|
"instructions": [
|
|
5
5
|
{
|
|
@@ -428,6 +428,72 @@
|
|
|
428
428
|
}
|
|
429
429
|
]
|
|
430
430
|
},
|
|
431
|
+
{
|
|
432
|
+
"name": "modifyOrder",
|
|
433
|
+
"accounts": [
|
|
434
|
+
{
|
|
435
|
+
"name": "state",
|
|
436
|
+
"isMut": false,
|
|
437
|
+
"isSigner": false
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "user",
|
|
441
|
+
"isMut": true,
|
|
442
|
+
"isSigner": false
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "authority",
|
|
446
|
+
"isMut": false,
|
|
447
|
+
"isSigner": true
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"args": [
|
|
451
|
+
{
|
|
452
|
+
"name": "orderId",
|
|
453
|
+
"type": {
|
|
454
|
+
"option": "u32"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "modifyOrderParams",
|
|
459
|
+
"type": {
|
|
460
|
+
"defined": "ModifyOrderParams"
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
]
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"name": "modifyOrderByUserId",
|
|
467
|
+
"accounts": [
|
|
468
|
+
{
|
|
469
|
+
"name": "state",
|
|
470
|
+
"isMut": false,
|
|
471
|
+
"isSigner": false
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"name": "user",
|
|
475
|
+
"isMut": true,
|
|
476
|
+
"isSigner": false
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "authority",
|
|
480
|
+
"isMut": false,
|
|
481
|
+
"isSigner": true
|
|
482
|
+
}
|
|
483
|
+
],
|
|
484
|
+
"args": [
|
|
485
|
+
{
|
|
486
|
+
"name": "userOrderId",
|
|
487
|
+
"type": "u8"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "modifyOrderParams",
|
|
491
|
+
"type": {
|
|
492
|
+
"defined": "ModifyOrderParams"
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
},
|
|
431
497
|
{
|
|
432
498
|
"name": "placeAndTakePerpOrder",
|
|
433
499
|
"accounts": [
|
|
@@ -4882,6 +4948,98 @@
|
|
|
4882
4948
|
]
|
|
4883
4949
|
}
|
|
4884
4950
|
},
|
|
4951
|
+
{
|
|
4952
|
+
"name": "ModifyOrderParams",
|
|
4953
|
+
"type": {
|
|
4954
|
+
"kind": "struct",
|
|
4955
|
+
"fields": [
|
|
4956
|
+
{
|
|
4957
|
+
"name": "direction",
|
|
4958
|
+
"type": {
|
|
4959
|
+
"option": {
|
|
4960
|
+
"defined": "PositionDirection"
|
|
4961
|
+
}
|
|
4962
|
+
}
|
|
4963
|
+
},
|
|
4964
|
+
{
|
|
4965
|
+
"name": "baseAssetAmount",
|
|
4966
|
+
"type": {
|
|
4967
|
+
"option": "u64"
|
|
4968
|
+
}
|
|
4969
|
+
},
|
|
4970
|
+
{
|
|
4971
|
+
"name": "price",
|
|
4972
|
+
"type": {
|
|
4973
|
+
"option": "u64"
|
|
4974
|
+
}
|
|
4975
|
+
},
|
|
4976
|
+
{
|
|
4977
|
+
"name": "reduceOnly",
|
|
4978
|
+
"type": {
|
|
4979
|
+
"option": "bool"
|
|
4980
|
+
}
|
|
4981
|
+
},
|
|
4982
|
+
{
|
|
4983
|
+
"name": "postOnly",
|
|
4984
|
+
"type": {
|
|
4985
|
+
"option": {
|
|
4986
|
+
"defined": "PostOnlyParam"
|
|
4987
|
+
}
|
|
4988
|
+
}
|
|
4989
|
+
},
|
|
4990
|
+
{
|
|
4991
|
+
"name": "immediateOrCancel",
|
|
4992
|
+
"type": {
|
|
4993
|
+
"option": "bool"
|
|
4994
|
+
}
|
|
4995
|
+
},
|
|
4996
|
+
{
|
|
4997
|
+
"name": "maxTs",
|
|
4998
|
+
"type": {
|
|
4999
|
+
"option": "i64"
|
|
5000
|
+
}
|
|
5001
|
+
},
|
|
5002
|
+
{
|
|
5003
|
+
"name": "triggerPrice",
|
|
5004
|
+
"type": {
|
|
5005
|
+
"option": "u64"
|
|
5006
|
+
}
|
|
5007
|
+
},
|
|
5008
|
+
{
|
|
5009
|
+
"name": "triggerCondition",
|
|
5010
|
+
"type": {
|
|
5011
|
+
"option": {
|
|
5012
|
+
"defined": "OrderTriggerCondition"
|
|
5013
|
+
}
|
|
5014
|
+
}
|
|
5015
|
+
},
|
|
5016
|
+
{
|
|
5017
|
+
"name": "oraclePriceOffset",
|
|
5018
|
+
"type": {
|
|
5019
|
+
"option": "i32"
|
|
5020
|
+
}
|
|
5021
|
+
},
|
|
5022
|
+
{
|
|
5023
|
+
"name": "auctionDuration",
|
|
5024
|
+
"type": {
|
|
5025
|
+
"option": "u8"
|
|
5026
|
+
}
|
|
5027
|
+
},
|
|
5028
|
+
{
|
|
5029
|
+
"name": "auctionStartPrice",
|
|
5030
|
+
"type": {
|
|
5031
|
+
"option": "i64"
|
|
5032
|
+
}
|
|
5033
|
+
},
|
|
5034
|
+
{
|
|
5035
|
+
"name": "auctionEndPrice",
|
|
5036
|
+
"type": {
|
|
5037
|
+
"option": "i64"
|
|
5038
|
+
}
|
|
5039
|
+
}
|
|
5040
|
+
]
|
|
5041
|
+
}
|
|
5042
|
+
},
|
|
4885
5043
|
{
|
|
4886
5044
|
"name": "LiquidatePerpRecord",
|
|
4887
5045
|
"type": {
|
|
@@ -5157,7 +5315,7 @@
|
|
|
5157
5315
|
"fields": [
|
|
5158
5316
|
{
|
|
5159
5317
|
"name": "revenueWithdrawSinceLastSettle",
|
|
5160
|
-
"type": "
|
|
5318
|
+
"type": "i64"
|
|
5161
5319
|
},
|
|
5162
5320
|
{
|
|
5163
5321
|
"name": "maxRevenueWithdrawPerPeriod",
|
|
@@ -6011,31 +6169,35 @@
|
|
|
6011
6169
|
}
|
|
6012
6170
|
},
|
|
6013
6171
|
{
|
|
6014
|
-
"name": "
|
|
6172
|
+
"name": "ModifyOrderId",
|
|
6015
6173
|
"type": {
|
|
6016
6174
|
"kind": "enum",
|
|
6017
6175
|
"variants": [
|
|
6018
6176
|
{
|
|
6019
|
-
"name": "
|
|
6177
|
+
"name": "UserOrderId",
|
|
6178
|
+
"fields": [
|
|
6179
|
+
"u8"
|
|
6180
|
+
]
|
|
6020
6181
|
},
|
|
6021
6182
|
{
|
|
6022
|
-
"name": "
|
|
6183
|
+
"name": "OrderId",
|
|
6184
|
+
"fields": [
|
|
6185
|
+
"u32"
|
|
6186
|
+
]
|
|
6023
6187
|
}
|
|
6024
6188
|
]
|
|
6025
6189
|
}
|
|
6026
6190
|
},
|
|
6027
6191
|
{
|
|
6028
|
-
"name": "
|
|
6192
|
+
"name": "PositionDirection",
|
|
6029
6193
|
"type": {
|
|
6030
6194
|
"kind": "enum",
|
|
6031
6195
|
"variants": [
|
|
6032
6196
|
{
|
|
6033
|
-
"name": "
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
}
|
|
6038
|
-
]
|
|
6197
|
+
"name": "Long"
|
|
6198
|
+
},
|
|
6199
|
+
{
|
|
6200
|
+
"name": "Short"
|
|
6039
6201
|
}
|
|
6040
6202
|
]
|
|
6041
6203
|
}
|
|
@@ -6049,7 +6211,7 @@
|
|
|
6049
6211
|
"name": "SerumV3"
|
|
6050
6212
|
},
|
|
6051
6213
|
{
|
|
6052
|
-
"name": "
|
|
6214
|
+
"name": "Match"
|
|
6053
6215
|
}
|
|
6054
6216
|
]
|
|
6055
6217
|
}
|
|
@@ -6410,7 +6572,7 @@
|
|
|
6410
6572
|
"kind": "enum",
|
|
6411
6573
|
"variants": [
|
|
6412
6574
|
{
|
|
6413
|
-
"name": "
|
|
6575
|
+
"name": "ExternalMarket"
|
|
6414
6576
|
},
|
|
6415
6577
|
{
|
|
6416
6578
|
"name": "Match"
|
|
@@ -8861,6 +9023,11 @@
|
|
|
8861
9023
|
"code": 6240,
|
|
8862
9024
|
"name": "InvalidMarketAccountforDeletion",
|
|
8863
9025
|
"msg": "Invalid MarketAccount for Deletion"
|
|
9026
|
+
},
|
|
9027
|
+
{
|
|
9028
|
+
"code": 6241,
|
|
9029
|
+
"name": "InvalidSpotFulfillmentParams",
|
|
9030
|
+
"msg": "Invalid Spot Fulfillment Params"
|
|
8864
9031
|
}
|
|
8865
9032
|
]
|
|
8866
9033
|
}
|
package/src/index.ts
CHANGED
package/src/math/amm.ts
CHANGED
package/src/math/funding.ts
CHANGED
package/src/math/insurance.ts
CHANGED
|
@@ -33,3 +33,32 @@ export function unstakeSharesToAmount(
|
|
|
33
33
|
|
|
34
34
|
return amount;
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
export function unstakeSharesToAmountWithOpenRequest(
|
|
38
|
+
nShares: BN,
|
|
39
|
+
withdrawRequestShares: BN,
|
|
40
|
+
withdrawRequestAmount: BN,
|
|
41
|
+
totalIfShares: BN,
|
|
42
|
+
insuranceFundVaultBalance: BN
|
|
43
|
+
): BN {
|
|
44
|
+
let stakedAmount: BN;
|
|
45
|
+
if (totalIfShares.gt(ZERO)) {
|
|
46
|
+
stakedAmount = BN.max(
|
|
47
|
+
ZERO,
|
|
48
|
+
nShares
|
|
49
|
+
.sub(withdrawRequestShares)
|
|
50
|
+
.mul(insuranceFundVaultBalance)
|
|
51
|
+
.div(totalIfShares)
|
|
52
|
+
);
|
|
53
|
+
} else {
|
|
54
|
+
stakedAmount = ZERO;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const withdrawAmount = BN.min(
|
|
58
|
+
withdrawRequestAmount,
|
|
59
|
+
withdrawRequestShares.mul(insuranceFundVaultBalance).div(totalIfShares)
|
|
60
|
+
);
|
|
61
|
+
const amount = withdrawAmount.add(stakedAmount);
|
|
62
|
+
|
|
63
|
+
return amount;
|
|
64
|
+
}
|
package/src/math/margin.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
BID_ASK_SPREAD_PRECISION,
|
|
7
7
|
AMM_RESERVE_PRECISION,
|
|
8
8
|
} from '../constants/numericConstants';
|
|
9
|
-
import { BN } from '@
|
|
9
|
+
import { BN } from '@coral-xyz/anchor';
|
|
10
10
|
import { OraclePriceData } from '../oracles/types';
|
|
11
11
|
import { PerpMarketAccount, PerpPosition } from '..';
|
|
12
12
|
import { isVariant } from '../types';
|
package/src/math/market.ts
CHANGED
package/src/math/oracles.ts
CHANGED
|
@@ -41,11 +41,10 @@ export function isOracleValid(
|
|
|
41
41
|
.div(BN.max(ONE, oraclePriceData.price))
|
|
42
42
|
.gt(oracleGuardRails.validity.tooVolatileRatio);
|
|
43
43
|
|
|
44
|
-
const isConfidenceTooLarge =
|
|
45
|
-
.add(BN.max(ONE, oraclePriceData.confidence))
|
|
44
|
+
const isConfidenceTooLarge = BN.max(ONE, oraclePriceData.confidence)
|
|
46
45
|
.mul(BID_ASK_SPREAD_PRECISION)
|
|
47
46
|
.div(oraclePriceData.price)
|
|
48
|
-
.gt(
|
|
47
|
+
.gt(oracleGuardRails.validity.confidenceIntervalMaxSize);
|
|
49
48
|
|
|
50
49
|
const oracleIsStale = oraclePriceData.slot
|
|
51
50
|
.sub(new BN(slot))
|
package/src/math/orders.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
PositionDirection,
|
|
9
9
|
} from '../types';
|
|
10
10
|
import { ZERO, TWO } from '../constants/numericConstants';
|
|
11
|
-
import { BN } from '@
|
|
11
|
+
import { BN } from '@coral-xyz/anchor';
|
|
12
12
|
import { OraclePriceData } from '../oracles/types';
|
|
13
13
|
import { getAuctionPrice, isAuctionComplete } from './auction';
|
|
14
14
|
import {
|
package/src/math/repeg.ts
CHANGED
package/src/math/spotBalance.ts
CHANGED
package/src/math/spotMarket.ts
CHANGED
package/src/math/spotPosition.ts
CHANGED
package/src/math/trade.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parsePriceData } from '@pythnetwork/client';
|
|
2
2
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
3
|
import { OracleClient, OraclePriceData } from './types';
|
|
4
|
-
import { BN } from '@
|
|
4
|
+
import { BN } from '@coral-xyz/anchor';
|
|
5
5
|
import {
|
|
6
6
|
ONE,
|
|
7
7
|
PRICE_PRECISION,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { OracleClient, OraclePriceData } from './types';
|
|
3
|
-
import { BN } from '@
|
|
3
|
+
import { BN } from '@coral-xyz/anchor';
|
|
4
4
|
import { PRICE_PRECISION } from '../constants/numericConstants';
|
|
5
5
|
|
|
6
6
|
export const QUOTE_ORACLE_PRICE_DATA: OraclePriceData = {
|
package/src/oracles/types.ts
CHANGED
package/src/orderParams.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OptionalOrderParams, OrderTriggerCondition, OrderType } from './types';
|
|
2
|
-
import { BN } from '@
|
|
2
|
+
import { BN } from '@coral-xyz/anchor';
|
|
3
3
|
|
|
4
4
|
export function getLimitOrderParams(
|
|
5
5
|
params: Omit<OptionalOrderParams, 'orderType' | 'marketType'> & { price: BN }
|
|
@@ -2,7 +2,7 @@ import { Connection, PublicKey } from '@solana/web3.js';
|
|
|
2
2
|
import { BulkAccountLoader } from '../accounts/bulkAccountLoader';
|
|
3
3
|
import { Market, Orderbook } from '@project-serum/serum';
|
|
4
4
|
import { SerumMarketSubscriberConfig } from './types';
|
|
5
|
-
import { BN } from '@
|
|
5
|
+
import { BN } from '@coral-xyz/anchor';
|
|
6
6
|
import { PRICE_PRECISION } from '../constants/numericConstants';
|
|
7
7
|
|
|
8
8
|
export class SerumSubscriber {
|
package/src/tokenFaucet.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as anchor from '@
|
|
2
|
-
import { AnchorProvider, Idl, Program } from '@
|
|
1
|
+
import * as anchor from '@coral-xyz/anchor';
|
|
2
|
+
import { AnchorProvider, Idl, Program } from '@coral-xyz/anchor';
|
|
3
3
|
import {
|
|
4
4
|
AccountInfo,
|
|
5
5
|
ASSOCIATED_TOKEN_PROGRAM_ID,
|
package/src/tx/retryTxSender.ts
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
TransactionInstruction,
|
|
15
15
|
AddressLookupTableAccount,
|
|
16
16
|
} from '@solana/web3.js';
|
|
17
|
-
import { AnchorProvider } from '@
|
|
17
|
+
import { AnchorProvider } from '@coral-xyz/anchor';
|
|
18
18
|
import assert from 'assert';
|
|
19
19
|
import bs58 from 'bs58';
|
|
20
20
|
|
package/src/tx/types.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -161,7 +161,8 @@ export class OrderTriggerCondition {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
export class SpotFulfillmentType {
|
|
164
|
-
static readonly
|
|
164
|
+
static readonly EXTERNAL = { external: {} };
|
|
165
|
+
static readonly MATCH = { match: {} };
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
export class SpotFulfillmentStatus {
|
|
@@ -880,6 +881,10 @@ export type OptionalOrderParams = {
|
|
|
880
881
|
[Property in keyof OrderParams]?: OrderParams[Property];
|
|
881
882
|
} & NecessaryOrderParams;
|
|
882
883
|
|
|
884
|
+
export type ModifyOrderParams = {
|
|
885
|
+
[Property in keyof OrderParams]?: OrderParams[Property] | null;
|
|
886
|
+
};
|
|
887
|
+
|
|
883
888
|
export const DefaultOrderParams: OrderParams = {
|
|
884
889
|
orderType: OrderType.MARKET,
|
|
885
890
|
marketType: MarketType.PERP,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
LPRecord,
|
|
17
17
|
InsuranceFundStakeRecord,
|
|
18
18
|
} from '..';
|
|
19
|
-
import { ProgramAccount } from '@
|
|
19
|
+
import { ProgramAccount } from '@coral-xyz/anchor';
|
|
20
20
|
import { AccountInfo, PublicKey } from '@solana/web3.js';
|
|
21
21
|
|
|
22
22
|
import { UserMap } from './userMap';
|