@drift-labs/sdk 2.101.0-beta.5 → 2.101.0-beta.7
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/driftClient.d.ts +1 -1
- package/lib/browser/driftClient.js +2 -2
- package/lib/browser/idl/switchboard_on_demand_30.json +13 -8
- package/lib/node/driftClient.d.ts +1 -1
- package/lib/node/driftClient.js +2 -2
- package/lib/node/idl/switchboard_on_demand_30.json +13 -8
- package/package.json +1 -1
- package/src/driftClient.ts +3 -2
- package/src/idl/switchboard_on_demand_30.json +13 -8
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.101.0-beta.
|
|
1
|
+
2.101.0-beta.7
|
|
@@ -509,7 +509,7 @@ export declare class DriftClient {
|
|
|
509
509
|
updateUserOpenOrdersCount(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
|
|
510
510
|
getUpdateUserOpenOrdersCountIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
511
511
|
placeAndTakePerpOrder(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, successCondition?: PlaceAndTakeOrderSuccessCondition, auctionDurationPercentage?: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
512
|
-
preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, bracketOrdersParams?: OptionalOrderParams[], txParams?: TxParams, subAccountId?: number, cancelExistingOrders?: boolean, settlePnl?: boolean, exitEarlyIfSimFails?: boolean): Promise<{
|
|
512
|
+
preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, bracketOrdersParams?: OptionalOrderParams[], txParams?: TxParams, subAccountId?: number, cancelExistingOrders?: boolean, settlePnl?: boolean, exitEarlyIfSimFails?: boolean, auctionDurationPercentage?: number): Promise<{
|
|
513
513
|
placeAndTakeTx: Transaction | VersionedTransaction;
|
|
514
514
|
cancelExistingOrdersTx: Transaction | VersionedTransaction;
|
|
515
515
|
settlePnlTx: Transaction | VersionedTransaction;
|
|
@@ -2881,7 +2881,7 @@ class DriftClient {
|
|
|
2881
2881
|
this.perpMarketLastSlotCache.set(orderParams.marketIndex, slot);
|
|
2882
2882
|
return txSig;
|
|
2883
2883
|
}
|
|
2884
|
-
async preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams, makerInfo, referrerInfo, bracketOrdersParams = new Array(), txParams, subAccountId, cancelExistingOrders, settlePnl, exitEarlyIfSimFails) {
|
|
2884
|
+
async preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams, makerInfo, referrerInfo, bracketOrdersParams = new Array(), txParams, subAccountId, cancelExistingOrders, settlePnl, exitEarlyIfSimFails, auctionDurationPercentage) {
|
|
2885
2885
|
const placeAndTakeIxs = [];
|
|
2886
2886
|
const txsToSign = {
|
|
2887
2887
|
placeAndTakeTx: undefined,
|
|
@@ -2893,7 +2893,7 @@ class DriftClient {
|
|
|
2893
2893
|
let earlyExitFailedPlaceAndTakeSim = false;
|
|
2894
2894
|
const prepPlaceAndTakeTx = async () => {
|
|
2895
2895
|
var _a;
|
|
2896
|
-
const placeAndTakeIx = await this.getPlaceAndTakePerpOrderIx(orderParams, makerInfo, referrerInfo, undefined,
|
|
2896
|
+
const placeAndTakeIx = await this.getPlaceAndTakePerpOrderIx(orderParams, makerInfo, referrerInfo, undefined, auctionDurationPercentage, subAccountId);
|
|
2897
2897
|
placeAndTakeIxs.push(placeAndTakeIx);
|
|
2898
2898
|
if (bracketOrdersParams.length > 0) {
|
|
2899
2899
|
const bracketOrdersIx = await this.getPlaceOrdersIx(bracketOrdersParams, subAccountId);
|
|
@@ -2396,12 +2396,19 @@
|
|
|
2396
2396
|
],
|
|
2397
2397
|
"type": "u8"
|
|
2398
2398
|
},
|
|
2399
|
+
{
|
|
2400
|
+
"name": "submission_idx",
|
|
2401
|
+
"docs": [
|
|
2402
|
+
"The index of the submission that was used to calculate this result"
|
|
2403
|
+
],
|
|
2404
|
+
"type": "u8"
|
|
2405
|
+
},
|
|
2399
2406
|
{
|
|
2400
2407
|
"name": "padding1",
|
|
2401
2408
|
"type": {
|
|
2402
2409
|
"array": [
|
|
2403
2410
|
"u8",
|
|
2404
|
-
|
|
2411
|
+
6
|
|
2405
2412
|
]
|
|
2406
2413
|
}
|
|
2407
2414
|
},
|
|
@@ -3019,13 +3026,11 @@
|
|
|
3019
3026
|
"type": "u64"
|
|
3020
3027
|
},
|
|
3021
3028
|
{
|
|
3022
|
-
"name": "
|
|
3023
|
-
"
|
|
3024
|
-
"
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
]
|
|
3028
|
-
}
|
|
3029
|
+
"name": "landed_at",
|
|
3030
|
+
"docs": [
|
|
3031
|
+
"The slot at which this value was landed on chain."
|
|
3032
|
+
],
|
|
3033
|
+
"type": "u64"
|
|
3029
3034
|
},
|
|
3030
3035
|
{
|
|
3031
3036
|
"name": "value",
|
|
@@ -509,7 +509,7 @@ export declare class DriftClient {
|
|
|
509
509
|
updateUserOpenOrdersCount(userAccountPublicKey: PublicKey, user: UserAccount, txParams?: TxParams, fillerPublicKey?: PublicKey): Promise<TransactionSignature>;
|
|
510
510
|
getUpdateUserOpenOrdersCountIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
|
|
511
511
|
placeAndTakePerpOrder(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, successCondition?: PlaceAndTakeOrderSuccessCondition, auctionDurationPercentage?: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
|
|
512
|
-
preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, bracketOrdersParams?: OptionalOrderParams[], txParams?: TxParams, subAccountId?: number, cancelExistingOrders?: boolean, settlePnl?: boolean, exitEarlyIfSimFails?: boolean): Promise<{
|
|
512
|
+
preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams: OptionalOrderParams, makerInfo?: MakerInfo | MakerInfo[], referrerInfo?: ReferrerInfo, bracketOrdersParams?: OptionalOrderParams[], txParams?: TxParams, subAccountId?: number, cancelExistingOrders?: boolean, settlePnl?: boolean, exitEarlyIfSimFails?: boolean, auctionDurationPercentage?: number): Promise<{
|
|
513
513
|
placeAndTakeTx: Transaction | VersionedTransaction;
|
|
514
514
|
cancelExistingOrdersTx: Transaction | VersionedTransaction;
|
|
515
515
|
settlePnlTx: Transaction | VersionedTransaction;
|
package/lib/node/driftClient.js
CHANGED
|
@@ -2881,7 +2881,7 @@ class DriftClient {
|
|
|
2881
2881
|
this.perpMarketLastSlotCache.set(orderParams.marketIndex, slot);
|
|
2882
2882
|
return txSig;
|
|
2883
2883
|
}
|
|
2884
|
-
async preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams, makerInfo, referrerInfo, bracketOrdersParams = new Array(), txParams, subAccountId, cancelExistingOrders, settlePnl, exitEarlyIfSimFails) {
|
|
2884
|
+
async preparePlaceAndTakePerpOrderWithAdditionalOrders(orderParams, makerInfo, referrerInfo, bracketOrdersParams = new Array(), txParams, subAccountId, cancelExistingOrders, settlePnl, exitEarlyIfSimFails, auctionDurationPercentage) {
|
|
2885
2885
|
const placeAndTakeIxs = [];
|
|
2886
2886
|
const txsToSign = {
|
|
2887
2887
|
placeAndTakeTx: undefined,
|
|
@@ -2893,7 +2893,7 @@ class DriftClient {
|
|
|
2893
2893
|
let earlyExitFailedPlaceAndTakeSim = false;
|
|
2894
2894
|
const prepPlaceAndTakeTx = async () => {
|
|
2895
2895
|
var _a;
|
|
2896
|
-
const placeAndTakeIx = await this.getPlaceAndTakePerpOrderIx(orderParams, makerInfo, referrerInfo, undefined,
|
|
2896
|
+
const placeAndTakeIx = await this.getPlaceAndTakePerpOrderIx(orderParams, makerInfo, referrerInfo, undefined, auctionDurationPercentage, subAccountId);
|
|
2897
2897
|
placeAndTakeIxs.push(placeAndTakeIx);
|
|
2898
2898
|
if (bracketOrdersParams.length > 0) {
|
|
2899
2899
|
const bracketOrdersIx = await this.getPlaceOrdersIx(bracketOrdersParams, subAccountId);
|
|
@@ -2396,12 +2396,19 @@
|
|
|
2396
2396
|
],
|
|
2397
2397
|
"type": "u8"
|
|
2398
2398
|
},
|
|
2399
|
+
{
|
|
2400
|
+
"name": "submission_idx",
|
|
2401
|
+
"docs": [
|
|
2402
|
+
"The index of the submission that was used to calculate this result"
|
|
2403
|
+
],
|
|
2404
|
+
"type": "u8"
|
|
2405
|
+
},
|
|
2399
2406
|
{
|
|
2400
2407
|
"name": "padding1",
|
|
2401
2408
|
"type": {
|
|
2402
2409
|
"array": [
|
|
2403
2410
|
"u8",
|
|
2404
|
-
|
|
2411
|
+
6
|
|
2405
2412
|
]
|
|
2406
2413
|
}
|
|
2407
2414
|
},
|
|
@@ -3019,13 +3026,11 @@
|
|
|
3019
3026
|
"type": "u64"
|
|
3020
3027
|
},
|
|
3021
3028
|
{
|
|
3022
|
-
"name": "
|
|
3023
|
-
"
|
|
3024
|
-
"
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
]
|
|
3028
|
-
}
|
|
3029
|
+
"name": "landed_at",
|
|
3030
|
+
"docs": [
|
|
3031
|
+
"The slot at which this value was landed on chain."
|
|
3032
|
+
],
|
|
3033
|
+
"type": "u64"
|
|
3029
3034
|
},
|
|
3030
3035
|
{
|
|
3031
3036
|
"name": "value",
|
package/package.json
CHANGED
package/src/driftClient.ts
CHANGED
|
@@ -5305,7 +5305,8 @@ export class DriftClient {
|
|
|
5305
5305
|
subAccountId?: number,
|
|
5306
5306
|
cancelExistingOrders?: boolean,
|
|
5307
5307
|
settlePnl?: boolean,
|
|
5308
|
-
exitEarlyIfSimFails?: boolean
|
|
5308
|
+
exitEarlyIfSimFails?: boolean,
|
|
5309
|
+
auctionDurationPercentage?: number
|
|
5309
5310
|
): Promise<{
|
|
5310
5311
|
placeAndTakeTx: Transaction | VersionedTransaction;
|
|
5311
5312
|
cancelExistingOrdersTx: Transaction | VersionedTransaction;
|
|
@@ -5333,7 +5334,7 @@ export class DriftClient {
|
|
|
5333
5334
|
makerInfo,
|
|
5334
5335
|
referrerInfo,
|
|
5335
5336
|
undefined,
|
|
5336
|
-
|
|
5337
|
+
auctionDurationPercentage,
|
|
5337
5338
|
subAccountId
|
|
5338
5339
|
);
|
|
5339
5340
|
|
|
@@ -2396,12 +2396,19 @@
|
|
|
2396
2396
|
],
|
|
2397
2397
|
"type": "u8"
|
|
2398
2398
|
},
|
|
2399
|
+
{
|
|
2400
|
+
"name": "submission_idx",
|
|
2401
|
+
"docs": [
|
|
2402
|
+
"The index of the submission that was used to calculate this result"
|
|
2403
|
+
],
|
|
2404
|
+
"type": "u8"
|
|
2405
|
+
},
|
|
2399
2406
|
{
|
|
2400
2407
|
"name": "padding1",
|
|
2401
2408
|
"type": {
|
|
2402
2409
|
"array": [
|
|
2403
2410
|
"u8",
|
|
2404
|
-
|
|
2411
|
+
6
|
|
2405
2412
|
]
|
|
2406
2413
|
}
|
|
2407
2414
|
},
|
|
@@ -3019,13 +3026,11 @@
|
|
|
3019
3026
|
"type": "u64"
|
|
3020
3027
|
},
|
|
3021
3028
|
{
|
|
3022
|
-
"name": "
|
|
3023
|
-
"
|
|
3024
|
-
"
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
]
|
|
3028
|
-
}
|
|
3029
|
+
"name": "landed_at",
|
|
3030
|
+
"docs": [
|
|
3031
|
+
"The slot at which this value was landed on chain."
|
|
3032
|
+
],
|
|
3033
|
+
"type": "u64"
|
|
3029
3034
|
},
|
|
3030
3035
|
{
|
|
3031
3036
|
"name": "value",
|