@drift-labs/sdk-browser 2.157.0-beta.8 → 2.158.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 CHANGED
@@ -1 +1 @@
1
- 2.157.0-beta.8
1
+ 2.158.0-beta.1
@@ -5,7 +5,7 @@
5
5
  import * as anchor from '@coral-xyz/anchor';
6
6
  import { AnchorProvider, BN, Program, ProgramAccount } from '@coral-xyz/anchor';
7
7
  import { Idl as Idl30, Program as Program30 } from '@coral-xyz/anchor-30';
8
- import { DriftClientMetricsEvents, HighLeverageModeConfig, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, OracleSource, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SignedMsgOrderParamsMessage, TxParams, UserAccount, UserStatsAccount, ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, PostOnlyParams, LPPoolAccount, ConstituentAccount, ConstituentTargetBaseAccount, AmmCache } from './types';
8
+ import { DriftClientMetricsEvents, HighLeverageModeConfig, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, OracleSource, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, ScaleOrderParams, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SignedMsgOrderParamsMessage, TxParams, UserAccount, UserStatsAccount, ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, PostOnlyParams, LPPoolAccount, ConstituentAccount, ConstituentTargetBaseAccount, AmmCache } from './types';
9
9
  import { AccountMeta, AddressLookupTableAccount, BlockhashWithExpiryBlockHeight, ConfirmOptions, Connection, Keypair, PublicKey, Signer, Transaction, TransactionInstruction, TransactionSignature, TransactionVersion, VersionedTransaction } from '@solana/web3.js';
10
10
  import { TokenFaucet } from './tokenFaucet';
11
11
  import { EventEmitter } from 'events';
@@ -578,6 +578,18 @@ export declare class DriftClient {
578
578
  authority?: PublicKey;
579
579
  }): Promise<TransactionInstruction>;
580
580
  getPlaceOrdersAndSetPositionMaxLevIx(params: OptionalOrderParams[], positionMaxLev: number, subAccountId?: number): Promise<TransactionInstruction[]>;
581
+ /**
582
+ * Place scale orders: multiple limit orders distributed across a price range
583
+ * @param params Scale order parameters
584
+ * @param txParams Optional transaction parameters
585
+ * @param subAccountId Optional sub account ID
586
+ * @returns Transaction signature
587
+ */
588
+ placeScaleOrders(params: ScaleOrderParams, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
589
+ preparePlaceScaleOrdersTx(params: ScaleOrderParams, txParams?: TxParams, subAccountId?: number): Promise<{
590
+ placeScaleOrdersTx: anchor.web3.Transaction | anchor.web3.VersionedTransaction;
591
+ }>;
592
+ getPlaceScaleOrdersIx(params: ScaleOrderParams, subAccountId?: number): Promise<TransactionInstruction>;
581
593
  fillPerpOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, txParams?: TxParams, fillerSubAccountId?: number, fillerAuthority?: PublicKey, hasBuilderFee?: boolean): Promise<TransactionSignature>;
582
594
  getFillPerpOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, fillerSubAccountId?: number, isSignedMsg?: boolean, fillerAuthority?: PublicKey, hasBuilderFee?: boolean): Promise<TransactionInstruction>;
583
595
  getRevertFillIx(fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
@@ -2282,13 +2282,14 @@ class DriftClient {
2282
2282
  const quoteSpotMarketIndex = perpMarketAccount.quoteSpotMarketIndex;
2283
2283
  associatedTokenAccount = await this.getAssociatedTokenAccount(quoteSpotMarketIndex);
2284
2284
  }
2285
- const withdrawIx = await this.getWithdrawFromIsolatedPerpPositionIx(amountToWithdraw, perpMarketIndex, associatedTokenAccount, subAccountId);
2286
- const ixs = [withdrawIx];
2285
+ const ixs = [];
2287
2286
  const needsToSettle = amount.gt(tokenAmountDeposited) && isolatedPositionUnrealizedPnl.gt(numericConstants_1.ZERO);
2288
2287
  if (needsToSettle) {
2289
2288
  const settleIx = await this.settleMultiplePNLsIx(userAccountPublicKey, userAccount, [perpMarketIndex], types_1.SettlePnlMode.TRY_SETTLE);
2290
2289
  ixs.push(settleIx);
2291
2290
  }
2291
+ const withdrawIx = await this.getWithdrawFromIsolatedPerpPositionIx(amountToWithdraw, perpMarketIndex, associatedTokenAccount, subAccountId);
2292
+ ixs.push(withdrawIx);
2292
2293
  return ixs;
2293
2294
  }
2294
2295
  async getWithdrawFromIsolatedPerpPositionIx(amount, perpMarketIndex, userTokenAccount, subAccountId) {
@@ -2867,6 +2868,65 @@ class DriftClient {
2867
2868
  const setPositionMaxLevIxs = await this.getUpdateUserPerpPositionCustomMarginRatioIx(readablePerpMarketIndex[0], marginRatio, subAccountId);
2868
2869
  return [placeOrdersIxs, setPositionMaxLevIxs];
2869
2870
  }
2871
+ /**
2872
+ * Place scale orders: multiple limit orders distributed across a price range
2873
+ * @param params Scale order parameters
2874
+ * @param txParams Optional transaction parameters
2875
+ * @param subAccountId Optional sub account ID
2876
+ * @returns Transaction signature
2877
+ */
2878
+ async placeScaleOrders(params, txParams, subAccountId) {
2879
+ const { txSig } = await this.sendTransaction((await this.preparePlaceScaleOrdersTx(params, txParams, subAccountId))
2880
+ .placeScaleOrdersTx, [], this.opts, false);
2881
+ return txSig;
2882
+ }
2883
+ async preparePlaceScaleOrdersTx(params, txParams, subAccountId) {
2884
+ const lookupTableAccounts = await this.fetchAllLookupTableAccounts();
2885
+ const tx = await this.buildTransaction(await this.getPlaceScaleOrdersIx(params, subAccountId), txParams, undefined, lookupTableAccounts);
2886
+ return {
2887
+ placeScaleOrdersTx: tx,
2888
+ };
2889
+ }
2890
+ async getPlaceScaleOrdersIx(params, subAccountId) {
2891
+ const user = await this.getUserAccountPublicKey(subAccountId);
2892
+ const isPerp = (0, types_1.isVariant)(params.marketType, 'perp');
2893
+ const remainingAccounts = this.getRemainingAccounts({
2894
+ userAccounts: [this.getUserAccount(subAccountId)],
2895
+ readablePerpMarketIndex: isPerp ? [params.marketIndex] : [],
2896
+ readableSpotMarketIndexes: isPerp ? [] : [params.marketIndex],
2897
+ useMarketLastSlotCache: true,
2898
+ });
2899
+ if ((0, orderParams_1.isUpdateHighLeverageMode)(params.bitFlags)) {
2900
+ remainingAccounts.push({
2901
+ pubkey: (0, pda_1.getHighLeverageModeConfigPublicKey)(this.program.programId),
2902
+ isWritable: true,
2903
+ isSigner: false,
2904
+ });
2905
+ }
2906
+ const formattedParams = {
2907
+ marketType: params.marketType,
2908
+ direction: params.direction,
2909
+ marketIndex: params.marketIndex,
2910
+ totalBaseAssetAmount: params.totalBaseAssetAmount,
2911
+ startPrice: params.startPrice,
2912
+ endPrice: params.endPrice,
2913
+ orderCount: params.orderCount,
2914
+ sizeDistribution: params.sizeDistribution,
2915
+ reduceOnly: params.reduceOnly,
2916
+ postOnly: params.postOnly,
2917
+ bitFlags: params.bitFlags,
2918
+ maxTs: params.maxTs,
2919
+ };
2920
+ return await this.program.instruction.placeScaleOrders(formattedParams, {
2921
+ accounts: {
2922
+ state: await this.getStatePublicKey(),
2923
+ user,
2924
+ userStats: this.getUserStatsAccountPublicKey(),
2925
+ authority: this.wallet.publicKey,
2926
+ },
2927
+ remainingAccounts,
2928
+ });
2929
+ }
2870
2930
  async fillPerpOrder(userAccountPublicKey, user, order, makerInfo, referrerInfo, txParams, fillerSubAccountId, fillerAuthority, hasBuilderFee) {
2871
2931
  const { txSig } = await this.sendTransaction(await this.buildTransaction(await this.getFillPerpOrderIx(userAccountPublicKey, user, order, makerInfo, referrerInfo, fillerSubAccountId, undefined, fillerAuthority, hasBuilderFee), txParams), [], this.opts);
2872
2932
  return txSig;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.156.0",
2
+ "version": "2.157.0",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
@@ -1382,6 +1382,34 @@
1382
1382
  }
1383
1383
  ]
1384
1384
  },
1385
+ {
1386
+ "name": "placeScaleOrders",
1387
+ "accounts": [
1388
+ {
1389
+ "name": "state",
1390
+ "isMut": false,
1391
+ "isSigner": false
1392
+ },
1393
+ {
1394
+ "name": "user",
1395
+ "isMut": true,
1396
+ "isSigner": false
1397
+ },
1398
+ {
1399
+ "name": "authority",
1400
+ "isMut": false,
1401
+ "isSigner": true
1402
+ }
1403
+ ],
1404
+ "args": [
1405
+ {
1406
+ "name": "params",
1407
+ "type": {
1408
+ "defined": "ScaleOrderParams"
1409
+ }
1410
+ }
1411
+ ]
1412
+ },
1385
1413
  {
1386
1414
  "name": "beginSwap",
1387
1415
  "accounts": [
@@ -13260,6 +13288,102 @@
13260
13288
  ]
13261
13289
  }
13262
13290
  },
13291
+ {
13292
+ "name": "ScaleOrderParams",
13293
+ "docs": [
13294
+ "Parameters for placing scale orders - multiple limit orders distributed across a price range"
13295
+ ],
13296
+ "type": {
13297
+ "kind": "struct",
13298
+ "fields": [
13299
+ {
13300
+ "name": "marketType",
13301
+ "type": {
13302
+ "defined": "MarketType"
13303
+ }
13304
+ },
13305
+ {
13306
+ "name": "direction",
13307
+ "type": {
13308
+ "defined": "PositionDirection"
13309
+ }
13310
+ },
13311
+ {
13312
+ "name": "marketIndex",
13313
+ "type": "u16"
13314
+ },
13315
+ {
13316
+ "name": "totalBaseAssetAmount",
13317
+ "docs": [
13318
+ "Total base asset amount to distribute across all orders"
13319
+ ],
13320
+ "type": "u64"
13321
+ },
13322
+ {
13323
+ "name": "startPrice",
13324
+ "docs": [
13325
+ "Starting price for the scale (in PRICE_PRECISION)"
13326
+ ],
13327
+ "type": "u64"
13328
+ },
13329
+ {
13330
+ "name": "endPrice",
13331
+ "docs": [
13332
+ "Ending price for the scale (in PRICE_PRECISION)"
13333
+ ],
13334
+ "type": "u64"
13335
+ },
13336
+ {
13337
+ "name": "orderCount",
13338
+ "docs": [
13339
+ "Number of orders to place (min 2, max 32)"
13340
+ ],
13341
+ "type": "u8"
13342
+ },
13343
+ {
13344
+ "name": "sizeDistribution",
13345
+ "docs": [
13346
+ "How to distribute sizes across orders"
13347
+ ],
13348
+ "type": {
13349
+ "defined": "SizeDistribution"
13350
+ }
13351
+ },
13352
+ {
13353
+ "name": "reduceOnly",
13354
+ "docs": [
13355
+ "Whether orders should be reduce-only"
13356
+ ],
13357
+ "type": "bool"
13358
+ },
13359
+ {
13360
+ "name": "postOnly",
13361
+ "docs": [
13362
+ "Post-only setting for all orders"
13363
+ ],
13364
+ "type": {
13365
+ "defined": "PostOnlyParam"
13366
+ }
13367
+ },
13368
+ {
13369
+ "name": "bitFlags",
13370
+ "docs": [
13371
+ "Bit flags (e.g., for high leverage mode)"
13372
+ ],
13373
+ "type": "u8"
13374
+ },
13375
+ {
13376
+ "name": "maxTs",
13377
+ "docs": [
13378
+ "Maximum timestamp for orders to be valid"
13379
+ ],
13380
+ "type": {
13381
+ "option": "i64"
13382
+ }
13383
+ }
13384
+ ]
13385
+ }
13386
+ },
13263
13387
  {
13264
13388
  "name": "InsuranceClaim",
13265
13389
  "type": {
@@ -15607,6 +15731,26 @@
15607
15731
  ]
15608
15732
  }
15609
15733
  },
15734
+ {
15735
+ "name": "SizeDistribution",
15736
+ "docs": [
15737
+ "How to distribute order sizes across scale orders"
15738
+ ],
15739
+ "type": {
15740
+ "kind": "enum",
15741
+ "variants": [
15742
+ {
15743
+ "name": "Flat"
15744
+ },
15745
+ {
15746
+ "name": "Ascending"
15747
+ },
15748
+ {
15749
+ "name": "Descending"
15750
+ }
15751
+ ]
15752
+ }
15753
+ },
15610
15754
  {
15611
15755
  "name": "PerpOperation",
15612
15756
  "type": {
@@ -19824,9 +19968,16 @@
19824
19968
  "code": 6345,
19825
19969
  "name": "InvalidIsolatedPerpMarket",
19826
19970
  "msg": "Invalid Isolated Perp Market"
19971
+ },
19972
+ {
19973
+ "code": 6346,
19974
+ "name": "InvalidOrderScaleOrderCount",
19975
+ "msg": "Invalid scale order count - must be between 2 and 10"
19976
+ },
19977
+ {
19978
+ "code": 6347,
19979
+ "name": "InvalidOrderScalePriceRange",
19980
+ "msg": "Invalid scale order price range"
19827
19981
  }
19828
- ],
19829
- "metadata": {
19830
- "address": "dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH"
19831
- }
19982
+ ]
19832
19983
  }
@@ -1346,6 +1346,46 @@ export declare class PostOnlyParams {
1346
1346
  slide: {};
1347
1347
  };
1348
1348
  }
1349
+ /**
1350
+ * How to distribute order sizes across scale orders
1351
+ */
1352
+ export declare class SizeDistribution {
1353
+ static readonly FLAT: {
1354
+ flat: {};
1355
+ };
1356
+ static readonly ASCENDING: {
1357
+ ascending: {};
1358
+ };
1359
+ static readonly DESCENDING: {
1360
+ descending: {};
1361
+ };
1362
+ }
1363
+ /**
1364
+ * Parameters for placing scale orders - multiple limit orders distributed across a price range
1365
+ */
1366
+ export type ScaleOrderParams = {
1367
+ marketType: MarketType;
1368
+ direction: PositionDirection;
1369
+ marketIndex: number;
1370
+ /** Total base asset amount to distribute across all orders */
1371
+ totalBaseAssetAmount: BN;
1372
+ /** Starting price for the scale (in PRICE_PRECISION) */
1373
+ startPrice: BN;
1374
+ /** Ending price for the scale (in PRICE_PRECISION) */
1375
+ endPrice: BN;
1376
+ /** Number of orders to place (min 2, max 32). User cannot exceed 32 total open orders. */
1377
+ orderCount: number;
1378
+ /** How to distribute sizes across orders */
1379
+ sizeDistribution: SizeDistribution;
1380
+ /** Whether orders should be reduce-only */
1381
+ reduceOnly: boolean;
1382
+ /** Post-only setting for all orders */
1383
+ postOnly: PostOnlyParams;
1384
+ /** Bit flags (e.g., for high leverage mode) */
1385
+ bitFlags: number;
1386
+ /** Maximum timestamp for orders to be valid */
1387
+ maxTs: BN | null;
1388
+ };
1349
1389
  export declare class OrderParamsBitFlag {
1350
1390
  static readonly ImmediateOrCancel = 1;
1351
1391
  static readonly UpdateHighLeverageMode = 2;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OracleValidity = exports.SwapReduceOnly = exports.PlaceAndTakeOrderSuccessCondition = exports.FuelOverflowStatus = exports.ReferrerStatus = exports.DefaultOrderParams = exports.ModifyOrderPolicy = exports.PositionFlag = exports.OrderParamsBitFlag = exports.PostOnlyParams = exports.LiquidationBitFlag = exports.LiquidationType = exports.LPAction = exports.TradeSide = exports.getVariant = exports.isOneOfVariant = exports.isVariant = exports.SettlePnlMode = exports.StakeAction = exports.SpotFulfillmentConfigStatus = exports.SettlePnlExplanation = exports.DepositExplanation = exports.SpotFulfillmentStatus = exports.SpotFulfillmentType = exports.OrderTriggerCondition = exports.OrderActionExplanation = exports.OrderAction = exports.OrderBitFlag = exports.OrderStatus = exports.MarketType = exports.OrderType = exports.OracleSourceNum = exports.OracleSource = exports.DepositDirection = exports.PositionDirection = exports.SpotBalanceType = exports.SwapDirection = exports.TokenProgramFlag = exports.AssetTier = exports.ContractTier = exports.ContractType = exports.MarginMode = exports.UserStatsPausedOperation = exports.UserStatus = exports.InsuranceFundOperation = exports.SpotOperation = exports.PerpOperation = exports.MarketStatus = exports.FeatureBitFlags = exports.ExchangeStatus = void 0;
4
- exports.ConstituentLpOperation = exports.ConstituentStatus = void 0;
3
+ exports.SwapReduceOnly = exports.PlaceAndTakeOrderSuccessCondition = exports.FuelOverflowStatus = exports.ReferrerStatus = exports.DefaultOrderParams = exports.ModifyOrderPolicy = exports.PositionFlag = exports.OrderParamsBitFlag = exports.SizeDistribution = exports.PostOnlyParams = exports.LiquidationBitFlag = exports.LiquidationType = exports.LPAction = exports.TradeSide = exports.getVariant = exports.isOneOfVariant = exports.isVariant = exports.SettlePnlMode = exports.StakeAction = exports.SpotFulfillmentConfigStatus = exports.SettlePnlExplanation = exports.DepositExplanation = exports.SpotFulfillmentStatus = exports.SpotFulfillmentType = exports.OrderTriggerCondition = exports.OrderActionExplanation = exports.OrderAction = exports.OrderBitFlag = exports.OrderStatus = exports.MarketType = exports.OrderType = exports.OracleSourceNum = exports.OracleSource = exports.DepositDirection = exports.PositionDirection = exports.SpotBalanceType = exports.SwapDirection = exports.TokenProgramFlag = exports.AssetTier = exports.ContractTier = exports.ContractType = exports.MarginMode = exports.UserStatsPausedOperation = exports.UserStatus = exports.InsuranceFundOperation = exports.SpotOperation = exports.PerpOperation = exports.MarketStatus = exports.FeatureBitFlags = exports.ExchangeStatus = void 0;
4
+ exports.ConstituentLpOperation = exports.ConstituentStatus = exports.OracleValidity = void 0;
5
5
  const numericConstants_1 = require("./constants/numericConstants");
6
6
  // # Utility Types / Enums / Constants
7
7
  var ExchangeStatus;
@@ -371,6 +371,15 @@ PostOnlyParams.NONE = { none: {} };
371
371
  PostOnlyParams.MUST_POST_ONLY = { mustPostOnly: {} }; // Tx fails if order can't be post only
372
372
  PostOnlyParams.TRY_POST_ONLY = { tryPostOnly: {} }; // Tx succeeds and order not placed if can't be post only
373
373
  PostOnlyParams.SLIDE = { slide: {} }; // Modify price to be post only if can't be post only
374
+ /**
375
+ * How to distribute order sizes across scale orders
376
+ */
377
+ class SizeDistribution {
378
+ }
379
+ exports.SizeDistribution = SizeDistribution;
380
+ SizeDistribution.FLAT = { flat: {} }; // Equal size for all orders
381
+ SizeDistribution.ASCENDING = { ascending: {} }; // Smallest at start price, largest at end price
382
+ SizeDistribution.DESCENDING = { descending: {} }; // Largest at start price, smallest at end price
374
383
  class OrderParamsBitFlag {
375
384
  }
376
385
  exports.OrderParamsBitFlag = OrderParamsBitFlag;
@@ -5,7 +5,7 @@
5
5
  import * as anchor from '@coral-xyz/anchor';
6
6
  import { AnchorProvider, BN, Program, ProgramAccount } from '@coral-xyz/anchor';
7
7
  import { Idl as Idl30, Program as Program30 } from '@coral-xyz/anchor-30';
8
- import { DriftClientMetricsEvents, HighLeverageModeConfig, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, OracleSource, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SignedMsgOrderParamsMessage, TxParams, UserAccount, UserStatsAccount, ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, PostOnlyParams, LPPoolAccount, ConstituentAccount, ConstituentTargetBaseAccount, AmmCache } from './types';
8
+ import { DriftClientMetricsEvents, HighLeverageModeConfig, IWallet, MakerInfo, MappedRecord, MarketType, ModifyOrderPolicy, OpenbookV2FulfillmentConfigAccount, OptionalOrderParams, OracleSource, Order, OrderParams, OrderTriggerCondition, PerpMarketAccount, PerpMarketExtendedInfo, PhoenixV1FulfillmentConfigAccount, PlaceAndTakeOrderSuccessCondition, PositionDirection, ReferrerInfo, ReferrerNameAccount, ScaleOrderParams, SerumV3FulfillmentConfigAccount, SettlePnlMode, SignedTxData, SpotMarketAccount, SpotPosition, StateAccount, SwapReduceOnly, SignedMsgOrderParamsMessage, TxParams, UserAccount, UserStatsAccount, ProtectedMakerModeConfig, SignedMsgOrderParamsDelegateMessage, PostOnlyParams, LPPoolAccount, ConstituentAccount, ConstituentTargetBaseAccount, AmmCache } from './types';
9
9
  import { AccountMeta, AddressLookupTableAccount, BlockhashWithExpiryBlockHeight, ConfirmOptions, Connection, Keypair, PublicKey, Signer, Transaction, TransactionInstruction, TransactionSignature, TransactionVersion, VersionedTransaction } from '@solana/web3.js';
10
10
  import { TokenFaucet } from './tokenFaucet';
11
11
  import { EventEmitter } from 'events';
@@ -578,6 +578,18 @@ export declare class DriftClient {
578
578
  authority?: PublicKey;
579
579
  }): Promise<TransactionInstruction>;
580
580
  getPlaceOrdersAndSetPositionMaxLevIx(params: OptionalOrderParams[], positionMaxLev: number, subAccountId?: number): Promise<TransactionInstruction[]>;
581
+ /**
582
+ * Place scale orders: multiple limit orders distributed across a price range
583
+ * @param params Scale order parameters
584
+ * @param txParams Optional transaction parameters
585
+ * @param subAccountId Optional sub account ID
586
+ * @returns Transaction signature
587
+ */
588
+ placeScaleOrders(params: ScaleOrderParams, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
589
+ preparePlaceScaleOrdersTx(params: ScaleOrderParams, txParams?: TxParams, subAccountId?: number): Promise<{
590
+ placeScaleOrdersTx: anchor.web3.Transaction | anchor.web3.VersionedTransaction;
591
+ }>;
592
+ getPlaceScaleOrdersIx(params: ScaleOrderParams, subAccountId?: number): Promise<TransactionInstruction>;
581
593
  fillPerpOrder(userAccountPublicKey: PublicKey, user: UserAccount, order?: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, txParams?: TxParams, fillerSubAccountId?: number, fillerAuthority?: PublicKey, hasBuilderFee?: boolean): Promise<TransactionSignature>;
582
594
  getFillPerpOrderIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, order: Pick<Order, 'marketIndex' | 'orderId'>, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, fillerSubAccountId?: number, isSignedMsg?: boolean, fillerAuthority?: PublicKey, hasBuilderFee?: boolean): Promise<TransactionInstruction>;
583
595
  getRevertFillIx(fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;