@drift-labs/vaults-sdk 0.1.294 → 0.1.296

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.
@@ -6,13 +6,14 @@ import { BN, DriftClient, UserMap } from '@drift-labs/sdk';
6
6
  import { Program, ProgramAccount } from '@coral-xyz/anchor';
7
7
  import { DriftVaults } from './types/drift_vaults';
8
8
  import { CompetitionsClient } from '@drift-labs/competitions-sdk';
9
- import { PublicKey, TransactionInstruction, TransactionSignature } from '@solana/web3.js';
9
+ import { AddressLookupTableAccount, PublicKey, TransactionInstruction, TransactionSignature } from '@solana/web3.js';
10
10
  import { Vault, VaultDepositor, WithdrawUnit } from './types/types';
11
11
  import { UserMapConfig } from '@drift-labs/sdk/lib/userMap/userMapConfig';
12
12
  export type TxParams = {
13
13
  cuLimit?: number;
14
14
  cuPriceMicroLamports?: number;
15
15
  simulateTransaction?: boolean;
16
+ lookupTables?: AddressLookupTableAccount[];
16
17
  };
17
18
  export declare class VaultClient {
18
19
  driftClient: DriftClient;
@@ -721,7 +721,7 @@ class VaultClient {
721
721
  * Used for UI wallet adapters compatibility
722
722
  */
723
723
  async createAndSendTxn(vaultIxs, txParams) {
724
- var _a, _b, _c;
724
+ var _a, _b, _c, _d;
725
725
  const ixs = [
726
726
  web3_js_1.ComputeBudgetProgram.setComputeUnitLimit({
727
727
  units: (_a = txParams === null || txParams === void 0 ? void 0 : txParams.cuLimit) !== null && _a !== void 0 ? _a : 400000,
@@ -731,7 +731,7 @@ class VaultClient {
731
731
  }),
732
732
  ...vaultIxs,
733
733
  ];
734
- const tx = await this.driftClient.txSender.getVersionedTransaction(ixs, [], undefined, {
734
+ const tx = await this.driftClient.txSender.getVersionedTransaction(ixs, (_c = txParams === null || txParams === void 0 ? void 0 : txParams.lookupTables) !== null && _c !== void 0 ? _c : [], undefined, {
735
735
  preflightCommitment: 'confirmed',
736
736
  ...this.driftClient.opts,
737
737
  });
@@ -746,7 +746,7 @@ class VaultClient {
746
746
  }
747
747
  catch (e) {
748
748
  const err = e;
749
- console.error(`Error simulating transaction: ${err.message}\n:${(_c = err.stack) !== null && _c !== void 0 ? _c : ''}`);
749
+ console.error(`Error simulating transaction: ${err.message}\n:${(_d = err.stack) !== null && _d !== void 0 ? _d : ''}`);
750
750
  }
751
751
  }
752
752
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/vaults-sdk",
3
- "version": "0.1.294",
3
+ "version": "0.1.296",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "directories": {
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "@coral-xyz/anchor": "^0.26.0",
11
11
  "@drift-labs/competitions-sdk": "0.2.303",
12
- "@drift-labs/sdk": "2.82.0-beta.15",
12
+ "@drift-labs/sdk": "2.82.0-beta.16",
13
13
  "@solana/web3.js": "1.73.2",
14
14
  "commander": "^11.0.0",
15
15
  "dotenv": "^16.3.1",
@@ -22,6 +22,7 @@ import {
22
22
  getVaultDepositorAddressSync,
23
23
  } from './addresses';
24
24
  import {
25
+ AddressLookupTableAccount,
25
26
  ComputeBudgetProgram,
26
27
  PublicKey,
27
28
  SystemProgram,
@@ -42,6 +43,7 @@ export type TxParams = {
42
43
  cuLimit?: number;
43
44
  cuPriceMicroLamports?: number;
44
45
  simulateTransaction?: boolean;
46
+ lookupTables?: AddressLookupTableAccount[];
45
47
  };
46
48
 
47
49
  export class VaultClient {
@@ -1124,7 +1126,7 @@ export class VaultClient {
1124
1126
 
1125
1127
  const tx = await this.driftClient.txSender.getVersionedTransaction(
1126
1128
  ixs,
1127
- [],
1129
+ txParams?.lookupTables ?? [],
1128
1130
  undefined,
1129
1131
  {
1130
1132
  preflightCommitment: 'confirmed',