@drift-labs/sdk 2.49.0-beta.4 → 2.49.0-beta.5
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/driftClient.d.ts +66 -66
- package/lib/driftClient.js +198 -192
- package/package.json +1 -1
- package/src/driftClient.ts +418 -270
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.49.0-beta.
|
|
1
|
+
2.49.0-beta.5
|
package/lib/driftClient.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ export declare class DriftClient {
|
|
|
149
149
|
*/
|
|
150
150
|
forceGetUserAccount(subAccountId?: number): Promise<UserAccount | undefined>;
|
|
151
151
|
getUserAccountAndSlot(subAccountId?: number): DataAndSlot<UserAccount> | undefined;
|
|
152
|
-
getSpotPosition(marketIndex: number): SpotPosition | undefined;
|
|
152
|
+
getSpotPosition(marketIndex: number, subAccountId?: number): SpotPosition | undefined;
|
|
153
153
|
getQuoteAssetTokenAmount(): BN;
|
|
154
154
|
/**
|
|
155
155
|
* Returns the token amount for a given market. The spot market precision is based on the token mint decimals.
|
|
@@ -192,8 +192,8 @@ export declare class DriftClient {
|
|
|
192
192
|
spotMarketAccountMap: Map<number, AccountMeta>;
|
|
193
193
|
perpMarketAccountMap: Map<number, AccountMeta>;
|
|
194
194
|
};
|
|
195
|
-
getOrder(orderId: number): Order | undefined;
|
|
196
|
-
getOrderByUserId(userOrderId: number): Order | undefined;
|
|
195
|
+
getOrder(orderId: number, subAccountId?: number): Order | undefined;
|
|
196
|
+
getOrderByUserId(userOrderId: number, subAccountId?: number): Order | undefined;
|
|
197
197
|
/**
|
|
198
198
|
* Get the associated token address for the given spot market
|
|
199
199
|
* @param marketIndex
|
|
@@ -204,11 +204,11 @@ export declare class DriftClient {
|
|
|
204
204
|
/**
|
|
205
205
|
* Deposit funds into the given spot market
|
|
206
206
|
*
|
|
207
|
-
* @param amount
|
|
208
|
-
* @param marketIndex
|
|
207
|
+
* @param amount to deposit
|
|
208
|
+
* @param marketIndex spot market index to deposit into
|
|
209
209
|
* @param associatedTokenAccount can be the wallet public key if using native sol
|
|
210
|
-
* @param subAccountId
|
|
211
|
-
* @param reduceOnly
|
|
210
|
+
* @param subAccountId subaccountId to deposit
|
|
211
|
+
* @param reduceOnly if true, deposit must not increase account risk
|
|
212
212
|
*/
|
|
213
213
|
deposit(amount: BN, marketIndex: number, associatedTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean): Promise<TransactionSignature>;
|
|
214
214
|
getDepositInstruction(amount: BN, marketIndex: number, userTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean, userInitialized?: boolean): Promise<TransactionInstruction>;
|
|
@@ -239,8 +239,8 @@ export declare class DriftClient {
|
|
|
239
239
|
* @param associatedTokenAddress - the token account to withdraw to. can be the wallet public key if using native sol
|
|
240
240
|
* @param reduceOnly
|
|
241
241
|
*/
|
|
242
|
-
withdraw(amount: BN, marketIndex: number, associatedTokenAddress: PublicKey, reduceOnly?: boolean): Promise<TransactionSignature>;
|
|
243
|
-
getWithdrawIx(amount: BN, marketIndex: number, userTokenAccount: PublicKey, reduceOnly?: boolean): Promise<TransactionInstruction>;
|
|
242
|
+
withdraw(amount: BN, marketIndex: number, associatedTokenAddress: PublicKey, reduceOnly?: boolean, subAccountId?: number): Promise<TransactionSignature>;
|
|
243
|
+
getWithdrawIx(amount: BN, marketIndex: number, userTokenAccount: PublicKey, reduceOnly?: boolean, subAccountId?: number): Promise<TransactionInstruction>;
|
|
244
244
|
/**
|
|
245
245
|
* Withdraws from the fromSubAccount and deposits into the toSubAccount
|
|
246
246
|
* @param amount
|
|
@@ -255,17 +255,17 @@ export declare class DriftClient {
|
|
|
255
255
|
updateSpotMarketCumulativeInterestIx(marketIndex: number): Promise<TransactionInstruction>;
|
|
256
256
|
settleLP(settleeUserAccountPublicKey: PublicKey, marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
257
257
|
settleLPIx(settleeUserAccountPublicKey: PublicKey, marketIndex: number): Promise<TransactionInstruction>;
|
|
258
|
-
removePerpLpShares(marketIndex: number, sharesToBurn?: BN, txParams?: TxParams): Promise<TransactionSignature>;
|
|
258
|
+
removePerpLpShares(marketIndex: number, sharesToBurn?: BN, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
259
259
|
removePerpLpSharesInExpiringMarket(marketIndex: number, userAccountPublicKey: PublicKey, sharesToBurn?: BN, txParams?: TxParams): Promise<TransactionSignature>;
|
|
260
260
|
getRemovePerpLpSharesInExpiringMarket(marketIndex: number, userAccountPublicKey: PublicKey, sharesToBurn?: BN): Promise<TransactionInstruction>;
|
|
261
|
-
getRemovePerpLpSharesIx(marketIndex: number, sharesToBurn?: BN): Promise<TransactionInstruction>;
|
|
262
|
-
addPerpLpShares(amount: BN, marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
263
|
-
getAddPerpLpSharesIx(amount: BN, marketIndex: number): Promise<TransactionInstruction>;
|
|
261
|
+
getRemovePerpLpSharesIx(marketIndex: number, sharesToBurn?: BN, subAccountId?: number): Promise<TransactionInstruction>;
|
|
262
|
+
addPerpLpShares(amount: BN, marketIndex: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
263
|
+
getAddPerpLpSharesIx(amount: BN, marketIndex: number, subAccountId?: number): Promise<TransactionInstruction>;
|
|
264
264
|
getQuoteValuePerLpShare(marketIndex: number): BN;
|
|
265
265
|
/**
|
|
266
266
|
* @deprecated use {@link placePerpOrder} or {@link placeAndTakePerpOrder} instead
|
|
267
267
|
*/
|
|
268
|
-
openPosition(direction: PositionDirection, amount: BN, marketIndex: number, limitPrice?: BN): Promise<TransactionSignature>;
|
|
268
|
+
openPosition(direction: PositionDirection, amount: BN, marketIndex: number, limitPrice?: BN, subAccountId?: number): Promise<TransactionSignature>;
|
|
269
269
|
sendSignedTx(tx: Transaction): Promise<TransactionSignature>;
|
|
270
270
|
/**
|
|
271
271
|
* Sends a market order and returns a signed tx which can fill the order against the vamm, which the caller can use to fill their own order if required.
|
|
@@ -283,35 +283,35 @@ export declare class DriftClient {
|
|
|
283
283
|
signedFillTx?: Transaction;
|
|
284
284
|
signedCancelExistingOrdersTx?: Transaction;
|
|
285
285
|
}>;
|
|
286
|
-
placePerpOrder(orderParams: OptionalOrderParams, txParams?: TxParams): Promise<TransactionSignature>;
|
|
287
|
-
getPlacePerpOrderIx(orderParams: OptionalOrderParams): Promise<TransactionInstruction>;
|
|
286
|
+
placePerpOrder(orderParams: OptionalOrderParams, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
287
|
+
getPlacePerpOrderIx(orderParams: OptionalOrderParams, subAccountId?: number): Promise<TransactionInstruction>;
|
|
288
288
|
updateAMMs(marketIndexes: number[], txParams?: TxParams): Promise<TransactionSignature>;
|
|
289
289
|
getUpdateAMMsIx(marketIndexes: number[]): Promise<TransactionInstruction>;
|
|
290
290
|
settleExpiredMarket(marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
291
291
|
getSettleExpiredMarketIx(marketIndex: number): Promise<TransactionInstruction>;
|
|
292
292
|
settleExpiredMarketPoolsToRevenuePool(perpMarketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
293
|
-
cancelOrder(orderId?: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
294
|
-
getCancelOrderIx(orderId?: number): Promise<TransactionInstruction>;
|
|
295
|
-
cancelOrderByUserId(userOrderId: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
296
|
-
getCancelOrderByUserIdIx(userOrderId: number): Promise<TransactionInstruction>;
|
|
297
|
-
cancelOrdersByIds(orderIds?: number[], txParams?: TxParams): Promise<TransactionSignature>;
|
|
298
|
-
getCancelOrdersByIdsIx(orderIds?: number[]): Promise<TransactionInstruction>;
|
|
299
|
-
cancelOrders(marketType?: MarketType, marketIndex?: number, direction?: PositionDirection, txParams?: TxParams): Promise<TransactionSignature>;
|
|
300
|
-
getCancelOrdersIx(marketType: MarketType | null, marketIndex: number | null, direction: PositionDirection | null): Promise<TransactionInstruction>;
|
|
293
|
+
cancelOrder(orderId?: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
294
|
+
getCancelOrderIx(orderId?: number, subAccountId?: number): Promise<TransactionInstruction>;
|
|
295
|
+
cancelOrderByUserId(userOrderId: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
296
|
+
getCancelOrderByUserIdIx(userOrderId: number, subAccountId?: number): Promise<TransactionInstruction>;
|
|
297
|
+
cancelOrdersByIds(orderIds?: number[], txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
298
|
+
getCancelOrdersByIdsIx(orderIds?: number[], subAccountId?: number): Promise<TransactionInstruction>;
|
|
299
|
+
cancelOrders(marketType?: MarketType, marketIndex?: number, direction?: PositionDirection, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
300
|
+
getCancelOrdersIx(marketType: MarketType | null, marketIndex: number | null, direction: PositionDirection | null, subAccountId?: number): Promise<TransactionInstruction>;
|
|
301
301
|
cancelAndPlaceOrders(cancelOrderParams: {
|
|
302
302
|
marketType?: MarketType;
|
|
303
303
|
marketIndex?: number;
|
|
304
304
|
direction?: PositionDirection;
|
|
305
|
-
}, placeOrderParams: OrderParams[], txParams?: TxParams): Promise<TransactionSignature>;
|
|
306
|
-
placeOrders(params: OrderParams[], txParams?: TxParams): Promise<TransactionSignature>;
|
|
307
|
-
getPlaceOrdersIx(params: OrderParams[]): Promise<TransactionInstruction>;
|
|
308
|
-
fillPerpOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<TransactionSignature>;
|
|
309
|
-
getFillPerpOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
310
|
-
getRevertFillIx(): Promise<TransactionInstruction>;
|
|
311
|
-
placeSpotOrder(orderParams: OptionalOrderParams, txParams?: TxParams): Promise<TransactionSignature>;
|
|
312
|
-
getPlaceSpotOrderIx(orderParams: OptionalOrderParams): Promise<TransactionInstruction>;
|
|
305
|
+
}, placeOrderParams: OrderParams[], txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
306
|
+
placeOrders(params: OrderParams[], txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
307
|
+
getPlaceOrdersIx(params: OrderParams[], subAccountId?: number): Promise<TransactionInstruction>;
|
|
308
|
+
fillPerpOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, txParams?: TxParams, fillerPublicKey?: number): Promise<TransactionSignature>;
|
|
309
|
+
getFillPerpOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, fillerSubAccountId?: number): Promise<TransactionInstruction>;
|
|
310
|
+
getRevertFillIx(fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
311
|
+
placeSpotOrder(orderParams: OptionalOrderParams, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
312
|
+
getPlaceSpotOrderIx(orderParams: OptionalOrderParams, subAccountId?: number): Promise<TransactionInstruction>;
|
|
313
313
|
fillSpotOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Order, fulfillmentConfig?: SerumV3FulfillmentConfigAccount | PhoenixV1FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<TransactionSignature>;
|
|
314
|
-
getFillSpotOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order?: Order, fulfillmentConfig?: SerumV3FulfillmentConfigAccount | PhoenixV1FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
314
|
+
getFillSpotOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order?: Order, fulfillmentConfig?: SerumV3FulfillmentConfigAccount | PhoenixV1FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
315
315
|
addSpotFulfillmentAccounts(marketIndex: number, remainingAccounts: AccountMeta[], fulfillmentConfig?: SerumV3FulfillmentConfigAccount | PhoenixV1FulfillmentConfigAccount): void;
|
|
316
316
|
addSerumRemainingAccounts(marketIndex: number, remainingAccounts: AccountMeta[], fulfillmentConfig: SerumV3FulfillmentConfigAccount): void;
|
|
317
317
|
addPhoenixRemainingAccounts(marketIndex: number, remainingAccounts: AccountMeta[], fulfillmentConfig: PhoenixV1FulfillmentConfigAccount): void;
|
|
@@ -412,26 +412,26 @@ export declare class DriftClient {
|
|
|
412
412
|
amount: BN;
|
|
413
413
|
userAccountPublicKey?: PublicKey;
|
|
414
414
|
}): Promise<TransactionInstruction[]>;
|
|
415
|
-
triggerOrder(userAccountPublicKey: PublicKey, user: UserAccount, order: Order, txParams?: TxParams): Promise<TransactionSignature>;
|
|
416
|
-
getTriggerOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Order): Promise<TransactionInstruction>;
|
|
417
|
-
forceCancelOrders(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams): Promise<TransactionSignature>;
|
|
418
|
-
getForceCancelOrdersIx(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionInstruction>;
|
|
419
|
-
updateUserIdle(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams): Promise<TransactionSignature>;
|
|
420
|
-
getUpdateUserIdleIx(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionInstruction>;
|
|
421
|
-
updateUserOpenOrdersCount(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams): Promise<TransactionSignature>;
|
|
422
|
-
getUpdateUserOpenOrdersCountIx(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionInstruction>;
|
|
423
|
-
placeAndTakePerpOrder(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<TransactionSignature>;
|
|
424
|
-
getPlaceAndTakePerpOrderIx(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
425
|
-
placeAndMakePerpOrder(orderParams: OptionalOrderParams, takerInfo: TakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<TransactionSignature>;
|
|
426
|
-
getPlaceAndMakePerpOrderIx(orderParams: OptionalOrderParams, takerInfo: TakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
427
|
-
placeAndTakeSpotOrder(orderParams: OptionalOrderParams, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<TransactionSignature>;
|
|
428
|
-
getPlaceAndTakeSpotOrderIx(orderParams: OptionalOrderParams, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
429
|
-
placeAndMakeSpotOrder(orderParams: OptionalOrderParams, takerInfo: TakerInfo, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, referrerInfo?: ReferrerInfo, txParams?: TxParams): Promise<TransactionSignature>;
|
|
430
|
-
getPlaceAndMakeSpotOrderIx(orderParams: OptionalOrderParams, takerInfo: TakerInfo, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, referrerInfo?: ReferrerInfo): Promise<TransactionInstruction>;
|
|
415
|
+
triggerOrder(userAccountPublicKey: PublicKey, user: UserAccount, order: Order, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
|
|
416
|
+
getTriggerOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Order, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
417
|
+
forceCancelOrders(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
|
|
418
|
+
getForceCancelOrdersIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
419
|
+
updateUserIdle(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
|
|
420
|
+
getUpdateUserIdleIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
421
|
+
updateUserOpenOrdersCount(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
|
|
422
|
+
getUpdateUserOpenOrdersCountIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
423
|
+
placeAndTakePerpOrder(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
424
|
+
getPlaceAndTakePerpOrderIx(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, subAccountId?: number): Promise<TransactionInstruction>;
|
|
425
|
+
placeAndMakePerpOrder(orderParams: OptionalOrderParams, takerInfo: TakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
426
|
+
getPlaceAndMakePerpOrderIx(orderParams: OptionalOrderParams, takerInfo: TakerInfo, referrerInfo?: ReferrerInfo, subAccountId?: number): Promise<TransactionInstruction>;
|
|
427
|
+
placeAndTakeSpotOrder(orderParams: OptionalOrderParams, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
428
|
+
getPlaceAndTakeSpotOrderIx(orderParams: OptionalOrderParams, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, makerInfo?: MakerInfo, referrerInfo?: ReferrerInfo, subAccountId?: number): Promise<TransactionInstruction>;
|
|
429
|
+
placeAndMakeSpotOrder(orderParams: OptionalOrderParams, takerInfo: TakerInfo, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, referrerInfo?: ReferrerInfo, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
430
|
+
getPlaceAndMakeSpotOrderIx(orderParams: OptionalOrderParams, takerInfo: TakerInfo, fulfillmentConfig?: SerumV3FulfillmentConfigAccount, referrerInfo?: ReferrerInfo, subAccountId?: number): Promise<TransactionInstruction>;
|
|
431
431
|
/**
|
|
432
432
|
* @deprecated use {@link placePerpOrder} or {@link placeAndTakePerpOrder} instead
|
|
433
433
|
*/
|
|
434
|
-
closePosition(marketIndex: number, limitPrice?: BN): Promise<TransactionSignature>;
|
|
434
|
+
closePosition(marketIndex: number, limitPrice?: BN, subAccountId?: number): Promise<TransactionSignature>;
|
|
435
435
|
/**
|
|
436
436
|
* Modifies an open order by closing it and replacing it with a new order.
|
|
437
437
|
* @deprecated use modifyOrder instead
|
|
@@ -486,7 +486,7 @@ export declare class DriftClient {
|
|
|
486
486
|
immediateOrCancel?: boolean;
|
|
487
487
|
maxTs?: BN;
|
|
488
488
|
policy?: ModifyOrderPolicy;
|
|
489
|
-
}, txParams?: TxParams): Promise<TransactionSignature>;
|
|
489
|
+
}, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
490
490
|
getModifyOrderIx({ orderId, newDirection, newBaseAmount, newLimitPrice, newOraclePriceOffset, newTriggerPrice, newTriggerCondition, auctionDuration, auctionStartPrice, auctionEndPrice, reduceOnly, postOnly, immediateOrCancel, maxTs, policy, }: {
|
|
491
491
|
orderId: number;
|
|
492
492
|
newDirection?: PositionDirection;
|
|
@@ -503,7 +503,7 @@ export declare class DriftClient {
|
|
|
503
503
|
immediateOrCancel?: boolean;
|
|
504
504
|
maxTs?: BN;
|
|
505
505
|
policy?: ModifyOrderPolicy;
|
|
506
|
-
}): Promise<TransactionInstruction>;
|
|
506
|
+
}, subAccountId?: number): Promise<TransactionInstruction>;
|
|
507
507
|
/**
|
|
508
508
|
* Modifies an open order by closing it and replacing it with a new order.
|
|
509
509
|
* @param orderParams.userOrderId: The open order to modify
|
|
@@ -538,7 +538,7 @@ export declare class DriftClient {
|
|
|
538
538
|
immediateOrCancel?: boolean;
|
|
539
539
|
policy?: ModifyOrderPolicy;
|
|
540
540
|
maxTs?: BN;
|
|
541
|
-
}, txParams?: TxParams): Promise<TransactionSignature>;
|
|
541
|
+
}, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
542
542
|
getModifyOrderByUserIdIx({ userOrderId, newDirection, newBaseAmount, newLimitPrice, newOraclePriceOffset, newTriggerPrice, newTriggerCondition, auctionDuration, auctionStartPrice, auctionEndPrice, reduceOnly, postOnly, immediateOrCancel, maxTs, policy, }: {
|
|
543
543
|
userOrderId: number;
|
|
544
544
|
newDirection?: PositionDirection;
|
|
@@ -556,7 +556,7 @@ export declare class DriftClient {
|
|
|
556
556
|
policy?: ModifyOrderPolicy;
|
|
557
557
|
maxTs?: BN;
|
|
558
558
|
txParams?: TxParams;
|
|
559
|
-
}): Promise<TransactionInstruction>;
|
|
559
|
+
}, subAccountId?: number): Promise<TransactionInstruction>;
|
|
560
560
|
settlePNLs(users: {
|
|
561
561
|
settleeUserAccountPublicKey: PublicKey;
|
|
562
562
|
settleeUserAccount: UserAccount;
|
|
@@ -567,18 +567,18 @@ export declare class DriftClient {
|
|
|
567
567
|
}[], marketIndexes: number[]): Promise<Array<TransactionInstruction>>;
|
|
568
568
|
settlePNL(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
569
569
|
settlePNLIx(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndex: number): Promise<TransactionInstruction>;
|
|
570
|
-
liquidatePerp(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, maxBaseAssetAmount: BN, limitPrice?: BN, txParams?: TxParams): Promise<TransactionSignature>;
|
|
571
|
-
getLiquidatePerpIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, maxBaseAssetAmount: BN, limitPrice?: BN): Promise<TransactionInstruction>;
|
|
572
|
-
liquidateSpot(userAccountPublicKey: PublicKey, userAccount: UserAccount, assetMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, txParams?: TxParams): Promise<TransactionSignature>;
|
|
573
|
-
getLiquidateSpotIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, assetMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN): Promise<TransactionInstruction>;
|
|
574
|
-
liquidateBorrowForPerpPnl(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, txParams?: TxParams): Promise<TransactionSignature>;
|
|
575
|
-
getLiquidateBorrowForPerpPnlIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN): Promise<TransactionInstruction>;
|
|
576
|
-
liquidatePerpPnlForDeposit(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, assetMarketIndex: number, maxPnlTransfer: BN, limitPrice?: BN, txParams?: TxParams): Promise<TransactionSignature>;
|
|
577
|
-
getLiquidatePerpPnlForDepositIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, assetMarketIndex: number, maxPnlTransfer: BN, limitPrice?: BN): Promise<TransactionInstruction>;
|
|
578
|
-
resolvePerpBankruptcy(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
579
|
-
getResolvePerpBankruptcyIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number): Promise<TransactionInstruction>;
|
|
580
|
-
resolveSpotBankruptcy(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
|
|
581
|
-
getResolveSpotBankruptcyIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number): Promise<TransactionInstruction>;
|
|
570
|
+
liquidatePerp(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, maxBaseAssetAmount: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
|
|
571
|
+
getLiquidatePerpIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, maxBaseAssetAmount: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
|
|
572
|
+
liquidateSpot(userAccountPublicKey: PublicKey, userAccount: UserAccount, assetMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
|
|
573
|
+
getLiquidateSpotIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, assetMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
|
|
574
|
+
liquidateBorrowForPerpPnl(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
|
|
575
|
+
getLiquidateBorrowForPerpPnlIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, liabilityMarketIndex: number, maxLiabilityTransfer: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
|
|
576
|
+
liquidatePerpPnlForDeposit(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, assetMarketIndex: number, maxPnlTransfer: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
|
|
577
|
+
getLiquidatePerpPnlForDepositIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, perpMarketIndex: number, assetMarketIndex: number, maxPnlTransfer: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
|
|
578
|
+
resolvePerpBankruptcy(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
|
|
579
|
+
getResolvePerpBankruptcyIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
|
|
580
|
+
resolveSpotBankruptcy(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
|
|
581
|
+
getResolveSpotBankruptcyIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
|
|
582
582
|
updateFundingRate(perpMarketIndex: number, oracle: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
|
|
583
583
|
getUpdateFundingRateIx(perpMarketIndex: number, oracle: PublicKey): Promise<TransactionInstruction>;
|
|
584
584
|
updatePerpBidAskTwap(perpMarketIndex: number, makers: [PublicKey, PublicKey][], txParams?: TxParams): Promise<TransactionSignature>;
|