@drift-labs/vaults-sdk 0.1.294 → 0.1.295
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/vaultClient.d.ts +2 -1
- package/lib/vaultClient.js +3 -3
- package/package.json +1 -1
- package/src/vaultClient.ts +3 -1
package/lib/vaultClient.d.ts
CHANGED
|
@@ -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;
|
package/lib/vaultClient.js
CHANGED
|
@@ -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:${(
|
|
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
package/src/vaultClient.ts
CHANGED
|
@@ -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',
|