@drift-labs/sdk 2.28.0-beta.5 → 2.28.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 +1 -1
- package/lib/driftClient.js +2 -2
- package/lib/idl/drift.json +1 -1
- package/lib/tx/retryTxSender.js +1 -1
- package/package.json +1 -1
- package/src/driftClient.ts +3 -2
- package/src/idl/drift.json +1 -1
- package/src/tx/retryTxSender.ts +1 -1
package/lib/driftClient.d.ts
CHANGED
|
@@ -241,7 +241,7 @@ export declare class DriftClient {
|
|
|
241
241
|
* @param bracketOrdersParams
|
|
242
242
|
* @returns
|
|
243
243
|
*/
|
|
244
|
-
sendMarketOrderAndGetSignedFillTx(orderParams: OptionalOrderParams, userAccountPublicKey: PublicKey, userAccount: UserAccount, makerInfo?: MakerInfo | MakerInfo[], txParams?: TxParams, bracketOrdersParams?: OptionalOrderParams[], referrerInfo?: ReferrerInfo): Promise<{
|
|
244
|
+
sendMarketOrderAndGetSignedFillTx(orderParams: OptionalOrderParams, userAccountPublicKey: PublicKey, userAccount: UserAccount, makerInfo?: MakerInfo | MakerInfo[], txParams?: TxParams, bracketOrdersParams?: OptionalOrderParams[], referrerInfo?: ReferrerInfo, useVersionedTx?: boolean): Promise<{
|
|
245
245
|
txSig: TransactionSignature;
|
|
246
246
|
signedFillTx: Transaction;
|
|
247
247
|
}>;
|
package/lib/driftClient.js
CHANGED
|
@@ -1374,7 +1374,7 @@ class DriftClient {
|
|
|
1374
1374
|
* @param bracketOrdersParams
|
|
1375
1375
|
* @returns
|
|
1376
1376
|
*/
|
|
1377
|
-
async sendMarketOrderAndGetSignedFillTx(orderParams, userAccountPublicKey, userAccount, makerInfo, txParams, bracketOrdersParams = new Array(), referrerInfo) {
|
|
1377
|
+
async sendMarketOrderAndGetSignedFillTx(orderParams, userAccountPublicKey, userAccount, makerInfo, txParams, bracketOrdersParams = new Array(), referrerInfo, useVersionedTx = true) {
|
|
1378
1378
|
var _a, _b;
|
|
1379
1379
|
const marketIndex = orderParams.marketIndex;
|
|
1380
1380
|
const orderId = userAccount.nextOrderId;
|
|
@@ -1393,7 +1393,7 @@ class DriftClient {
|
|
|
1393
1393
|
//@ts-ignore
|
|
1394
1394
|
(_b = (_a = this.wallet.supportedTransactionVersions) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0 > 1;
|
|
1395
1395
|
// use versioned transactions if there is a lookup table account and wallet is compatible
|
|
1396
|
-
if (walletSupportsVersionedTxns && lookupTableAccount) {
|
|
1396
|
+
if (walletSupportsVersionedTxns && lookupTableAccount && useVersionedTx) {
|
|
1397
1397
|
const versionedMarketOrderTx = await this.txSender.getVersionedTransaction([placePerpOrderIx].concat(bracketOrderIxs), [lookupTableAccount], [], this.opts);
|
|
1398
1398
|
const versionedFillTx = await this.txSender.getVersionedTransaction([fillPerpOrderIx], [lookupTableAccount], [], this.opts);
|
|
1399
1399
|
const [signedVersionedMarketOrderTx, signedVersionedFillTx] = await this.provider.wallet.signAllTransactions([
|
package/lib/idl/drift.json
CHANGED
package/lib/tx/retryTxSender.js
CHANGED
|
@@ -56,7 +56,7 @@ class RetryTxSender {
|
|
|
56
56
|
}
|
|
57
57
|
async sendVersionedTransaction(tx, additionalSigners, opts) {
|
|
58
58
|
// @ts-ignore
|
|
59
|
-
tx.sign(additionalSigners.concat(this.provider.wallet.payer));
|
|
59
|
+
tx.sign((additionalSigners !== null && additionalSigners !== void 0 ? additionalSigners : []).concat(this.provider.wallet.payer));
|
|
60
60
|
return this.sendRawTransaction(tx.serialize(), opts);
|
|
61
61
|
}
|
|
62
62
|
async sendRawTransaction(rawTransaction, opts) {
|
package/package.json
CHANGED
package/src/driftClient.ts
CHANGED
|
@@ -2350,7 +2350,8 @@ export class DriftClient {
|
|
|
2350
2350
|
makerInfo?: MakerInfo | MakerInfo[],
|
|
2351
2351
|
txParams?: TxParams,
|
|
2352
2352
|
bracketOrdersParams = new Array<OptionalOrderParams>(),
|
|
2353
|
-
referrerInfo?: ReferrerInfo
|
|
2353
|
+
referrerInfo?: ReferrerInfo,
|
|
2354
|
+
useVersionedTx = true
|
|
2354
2355
|
): Promise<{ txSig: TransactionSignature; signedFillTx: Transaction }> {
|
|
2355
2356
|
const marketIndex = orderParams.marketIndex;
|
|
2356
2357
|
const orderId = userAccount.nextOrderId;
|
|
@@ -2383,7 +2384,7 @@ export class DriftClient {
|
|
|
2383
2384
|
this.wallet.supportedTransactionVersions?.size ?? 0 > 1;
|
|
2384
2385
|
|
|
2385
2386
|
// use versioned transactions if there is a lookup table account and wallet is compatible
|
|
2386
|
-
if (walletSupportsVersionedTxns && lookupTableAccount) {
|
|
2387
|
+
if (walletSupportsVersionedTxns && lookupTableAccount && useVersionedTx) {
|
|
2387
2388
|
const versionedMarketOrderTx =
|
|
2388
2389
|
await this.txSender.getVersionedTransaction(
|
|
2389
2390
|
[placePerpOrderIx].concat(bracketOrderIxs),
|
package/src/idl/drift.json
CHANGED
package/src/tx/retryTxSender.ts
CHANGED
|
@@ -120,7 +120,7 @@ export class RetryTxSender implements TxSender {
|
|
|
120
120
|
opts?: ConfirmOptions
|
|
121
121
|
): Promise<TxSigAndSlot> {
|
|
122
122
|
// @ts-ignore
|
|
123
|
-
tx.sign(additionalSigners.concat(this.provider.wallet.payer));
|
|
123
|
+
tx.sign((additionalSigners ?? []).concat(this.provider.wallet.payer));
|
|
124
124
|
|
|
125
125
|
return this.sendRawTransaction(tx.serialize(), opts);
|
|
126
126
|
}
|