@drift-labs/sdk 2.29.0 → 2.30.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/lib/driftClient.d.ts +5 -5
- package/lib/idl/drift.json +1 -1
- package/package.json +1 -1
- package/src/driftClient.ts +5 -4
- package/src/idl/drift.json +1 -1
package/lib/driftClient.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { AnchorProvider, BN, Program, ProgramAccount } from '@coral-xyz/anchor';
|
|
3
|
-
import { StateAccount, IWallet, PositionDirection, UserAccount, PerpMarketAccount, OrderParams, Order, SpotMarketAccount, SpotPosition, MakerInfo, TakerInfo, OptionalOrderParams, ReferrerInfo, MarketType, TxParams, SerumV3FulfillmentConfigAccount, ReferrerNameAccount, OrderTriggerCondition, PerpMarketExtendedInfo, UserStatsAccount,
|
|
3
|
+
import { StateAccount, IWallet, PositionDirection, UserAccount, PerpMarketAccount, OrderParams, Order, SpotMarketAccount, SpotPosition, MakerInfo, TakerInfo, OptionalOrderParams, ReferrerInfo, MarketType, TxParams, SerumV3FulfillmentConfigAccount, ReferrerNameAccount, OrderTriggerCondition, PerpMarketExtendedInfo, UserStatsAccount, PhoenixV1FulfillmentConfigAccount, ModifyOrderPolicy } from './types';
|
|
4
4
|
import * as anchor from '@coral-xyz/anchor';
|
|
5
5
|
import { Connection, PublicKey, TransactionSignature, ConfirmOptions, Transaction, TransactionInstruction, AccountMeta, Signer, AddressLookupTableAccount, TransactionVersion, VersionedTransaction } from '@solana/web3.js';
|
|
6
6
|
import { TokenFaucet } from './tokenFaucet';
|
|
@@ -345,7 +345,7 @@ export declare class DriftClient {
|
|
|
345
345
|
postOnly?: boolean;
|
|
346
346
|
immediateOrCancel?: boolean;
|
|
347
347
|
maxTs?: BN;
|
|
348
|
-
policy?:
|
|
348
|
+
policy?: ModifyOrderPolicy;
|
|
349
349
|
}, txParams?: TxParams): Promise<TransactionSignature>;
|
|
350
350
|
getModifyOrderIx({ orderId, newDirection, newBaseAmount, newLimitPrice, newOraclePriceOffset, newTriggerPrice, newTriggerCondition, auctionDuration, auctionStartPrice, auctionEndPrice, reduceOnly, postOnly, immediateOrCancel, maxTs, policy, }: {
|
|
351
351
|
orderId: number;
|
|
@@ -362,7 +362,7 @@ export declare class DriftClient {
|
|
|
362
362
|
postOnly?: boolean;
|
|
363
363
|
immediateOrCancel?: boolean;
|
|
364
364
|
maxTs?: BN;
|
|
365
|
-
policy?:
|
|
365
|
+
policy?: ModifyOrderPolicy;
|
|
366
366
|
}): Promise<TransactionInstruction>;
|
|
367
367
|
/**
|
|
368
368
|
* Modifies an open order by closing it and replacing it with a new order.
|
|
@@ -396,7 +396,7 @@ export declare class DriftClient {
|
|
|
396
396
|
reduceOnly?: boolean;
|
|
397
397
|
postOnly?: boolean;
|
|
398
398
|
immediateOrCancel?: boolean;
|
|
399
|
-
policy?:
|
|
399
|
+
policy?: ModifyOrderPolicy;
|
|
400
400
|
maxTs?: BN;
|
|
401
401
|
}, txParams?: TxParams): Promise<TransactionSignature>;
|
|
402
402
|
getModifyOrderByUserIdIx({ userOrderId, newDirection, newBaseAmount, newLimitPrice, newOraclePriceOffset, newTriggerPrice, newTriggerCondition, auctionDuration, auctionStartPrice, auctionEndPrice, reduceOnly, postOnly, immediateOrCancel, maxTs, policy, }: {
|
|
@@ -413,7 +413,7 @@ export declare class DriftClient {
|
|
|
413
413
|
reduceOnly?: boolean;
|
|
414
414
|
postOnly?: boolean;
|
|
415
415
|
immediateOrCancel?: boolean;
|
|
416
|
-
policy?:
|
|
416
|
+
policy?: ModifyOrderPolicy;
|
|
417
417
|
maxTs?: BN;
|
|
418
418
|
txParams?: TxParams;
|
|
419
419
|
}): Promise<TransactionInstruction>;
|
package/lib/idl/drift.json
CHANGED
package/package.json
CHANGED
package/src/driftClient.ts
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
UserStatsAccount,
|
|
39
39
|
ModifyOrderParams,
|
|
40
40
|
PhoenixV1FulfillmentConfigAccount,
|
|
41
|
+
ModifyOrderPolicy,
|
|
41
42
|
} from './types';
|
|
42
43
|
import * as anchor from '@coral-xyz/anchor';
|
|
43
44
|
import driftIDL from './idl/drift.json';
|
|
@@ -3839,7 +3840,7 @@ export class DriftClient {
|
|
|
3839
3840
|
postOnly?: boolean;
|
|
3840
3841
|
immediateOrCancel?: boolean;
|
|
3841
3842
|
maxTs?: BN;
|
|
3842
|
-
policy?:
|
|
3843
|
+
policy?: ModifyOrderPolicy;
|
|
3843
3844
|
},
|
|
3844
3845
|
txParams?: TxParams
|
|
3845
3846
|
): Promise<TransactionSignature> {
|
|
@@ -3885,7 +3886,7 @@ export class DriftClient {
|
|
|
3885
3886
|
postOnly?: boolean;
|
|
3886
3887
|
immediateOrCancel?: boolean;
|
|
3887
3888
|
maxTs?: BN;
|
|
3888
|
-
policy?:
|
|
3889
|
+
policy?: ModifyOrderPolicy;
|
|
3889
3890
|
}): Promise<TransactionInstruction> {
|
|
3890
3891
|
const userAccountPublicKey = await this.getUserAccountPublicKey();
|
|
3891
3892
|
|
|
@@ -3955,7 +3956,7 @@ export class DriftClient {
|
|
|
3955
3956
|
reduceOnly?: boolean;
|
|
3956
3957
|
postOnly?: boolean;
|
|
3957
3958
|
immediateOrCancel?: boolean;
|
|
3958
|
-
policy?:
|
|
3959
|
+
policy?: ModifyOrderPolicy;
|
|
3959
3960
|
maxTs?: BN;
|
|
3960
3961
|
},
|
|
3961
3962
|
txParams?: TxParams
|
|
@@ -4001,7 +4002,7 @@ export class DriftClient {
|
|
|
4001
4002
|
reduceOnly?: boolean;
|
|
4002
4003
|
postOnly?: boolean;
|
|
4003
4004
|
immediateOrCancel?: boolean;
|
|
4004
|
-
policy?:
|
|
4005
|
+
policy?: ModifyOrderPolicy;
|
|
4005
4006
|
maxTs?: BN;
|
|
4006
4007
|
txParams?: TxParams;
|
|
4007
4008
|
}): Promise<TransactionInstruction> {
|
package/src/idl/drift.json
CHANGED