@drift-labs/vaults-sdk 0.1.320 → 0.1.322
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/accounts/vaultAccount.d.ts +0 -1
- package/lib/accounts/vaultDepositorAccount.d.ts +0 -1
- package/lib/addresses.d.ts +0 -1
- package/lib/parsers/logParser.d.ts +0 -1
- package/lib/types/types.d.ts +0 -1
- package/lib/utils.d.ts +0 -1
- package/lib/vaultClient.d.ts +0 -1
- package/lib/vaultClient.js +3 -0
- package/package.json +4 -4
- package/src/utils.ts +1 -1
- package/src/vaultClient.ts +3 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" />
|
|
3
3
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
|
4
|
-
/// <reference types="@pythnetwork/client/node_modules/@solana/web3.js" />
|
|
5
4
|
import { Program } from '@coral-xyz/anchor';
|
|
6
5
|
import { BulkAccountLoader, BN } from '@drift-labs/sdk';
|
|
7
6
|
import { PublicKey } from '@solana/web3.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" />
|
|
3
3
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
|
4
|
-
/// <reference types="@pythnetwork/client/node_modules/@solana/web3.js" />
|
|
5
4
|
import { Program } from '@coral-xyz/anchor';
|
|
6
5
|
import { BN, BulkAccountLoader } from '@drift-labs/sdk';
|
|
7
6
|
import { PublicKey } from '@solana/web3.js';
|
package/lib/addresses.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" />
|
|
2
2
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
|
3
|
-
/// <reference types="@pythnetwork/client/node_modules/@solana/web3.js" />
|
|
4
3
|
import { PublicKey } from '@solana/web3.js';
|
|
5
4
|
export declare function getVaultAddressSync(programId: PublicKey, encodedName: number[]): PublicKey;
|
|
6
5
|
export declare function getVaultDepositorAddressSync(programId: PublicKey, vault: PublicKey, authority: PublicKey): PublicKey;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" />
|
|
2
2
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
|
3
|
-
/// <reference types="@pythnetwork/client/node_modules/@solana/web3.js" />
|
|
4
3
|
import { Program } from '@coral-xyz/anchor';
|
|
5
4
|
import { TransactionSignature } from '@solana/web3.js';
|
|
6
5
|
import { WrappedEvents } from '../types/types';
|
package/lib/types/types.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" />
|
|
4
4
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
|
5
|
-
/// <reference types="@pythnetwork/client/node_modules/@solana/web3.js" />
|
|
6
5
|
import { BN, DataAndSlot, Event } from '@drift-labs/sdk';
|
|
7
6
|
import { PublicKey } from '@solana/web3.js';
|
|
8
7
|
import { EventEmitter } from 'events';
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" />
|
|
2
2
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
|
3
|
-
/// <reference types="@pythnetwork/client/node_modules/@solana/web3.js" />
|
|
4
3
|
import { DriftClient, IWallet } from '@drift-labs/sdk';
|
|
5
4
|
import { Connection } from '@solana/web3.js';
|
|
6
5
|
import { DriftVaults } from './types/drift_vaults';
|
package/lib/vaultClient.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
/// <reference types="@coral-xyz/anchor/node_modules/@solana/web3.js" />
|
|
3
3
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
|
4
|
-
/// <reference types="@pythnetwork/client/node_modules/@solana/web3.js" />
|
|
5
4
|
import { BN, DriftClient, UserMap } from '@drift-labs/sdk';
|
|
6
5
|
import { Program, ProgramAccount } from '@coral-xyz/anchor';
|
|
7
6
|
import { DriftVaults } from './types/drift_vaults';
|
package/lib/vaultClient.js
CHANGED
|
@@ -241,6 +241,7 @@ class VaultClient {
|
|
|
241
241
|
.rpc();
|
|
242
242
|
}
|
|
243
243
|
async managerRequestWithdraw(vault, amount, withdrawUnit) {
|
|
244
|
+
this.program.idl.types;
|
|
244
245
|
// @ts-ignore
|
|
245
246
|
const vaultAccount = (await this.program.account.vault.fetch(vault));
|
|
246
247
|
if (!this.driftClient.wallet.publicKey.equals(vaultAccount.manager)) {
|
|
@@ -261,6 +262,7 @@ class VaultClient {
|
|
|
261
262
|
};
|
|
262
263
|
if (this.cliMode) {
|
|
263
264
|
return await this.program.methods
|
|
265
|
+
// @ts-ignore, 0.29.0 anchor issues..
|
|
264
266
|
.managerRequestWithdraw(amount, withdrawUnit)
|
|
265
267
|
.accounts(accounts)
|
|
266
268
|
.remainingAccounts(remainingAccounts)
|
|
@@ -510,6 +512,7 @@ class VaultClient {
|
|
|
510
512
|
};
|
|
511
513
|
if (this.cliMode) {
|
|
512
514
|
return await this.program.methods
|
|
515
|
+
// @ts-ignore
|
|
513
516
|
.requestWithdraw(amount, withdrawUnit)
|
|
514
517
|
.accounts(accounts)
|
|
515
518
|
.remainingAccounts(remainingAccounts)
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drift-labs/vaults-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.322",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"directories": {
|
|
7
7
|
"lib": "lib"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@coral-xyz/anchor": "
|
|
11
|
-
"@drift-labs/competitions-sdk": "0.2.
|
|
12
|
-
"@drift-labs/sdk": "2.84.0-beta.
|
|
10
|
+
"@coral-xyz/anchor": "0.28.0",
|
|
11
|
+
"@drift-labs/competitions-sdk": "0.2.334",
|
|
12
|
+
"@drift-labs/sdk": "2.84.0-beta.7",
|
|
13
13
|
"@solana/web3.js": "1.73.2",
|
|
14
14
|
"commander": "^11.0.0",
|
|
15
15
|
"dotenv": "^16.3.1",
|
package/src/utils.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const getDriftVaultProgram = (
|
|
|
10
10
|
connection: Connection,
|
|
11
11
|
wallet: IWallet
|
|
12
12
|
): anchor.Program<DriftVaults> => {
|
|
13
|
-
const provider = new AnchorProvider(connection, wallet, {});
|
|
13
|
+
const provider = new AnchorProvider(connection, wallet as anchor.Wallet, {});
|
|
14
14
|
anchor.setProvider(provider);
|
|
15
15
|
const vaultProgram = new anchor.Program(IDL, VAULT_PROGRAM_ID, provider);
|
|
16
16
|
|
package/src/vaultClient.ts
CHANGED
|
@@ -398,6 +398,7 @@ export class VaultClient {
|
|
|
398
398
|
amount: BN,
|
|
399
399
|
withdrawUnit: WithdrawUnit
|
|
400
400
|
): Promise<TransactionSignature> {
|
|
401
|
+
this.program.idl.types;
|
|
401
402
|
// @ts-ignore
|
|
402
403
|
const vaultAccount = (await this.program.account.vault.fetch(
|
|
403
404
|
vault
|
|
@@ -429,6 +430,7 @@ export class VaultClient {
|
|
|
429
430
|
|
|
430
431
|
if (this.cliMode) {
|
|
431
432
|
return await this.program.methods
|
|
433
|
+
// @ts-ignore, 0.29.0 anchor issues..
|
|
432
434
|
.managerRequestWithdraw(amount, withdrawUnit)
|
|
433
435
|
.accounts(accounts)
|
|
434
436
|
.remainingAccounts(remainingAccounts)
|
|
@@ -812,6 +814,7 @@ export class VaultClient {
|
|
|
812
814
|
|
|
813
815
|
if (this.cliMode) {
|
|
814
816
|
return await this.program.methods
|
|
817
|
+
// @ts-ignore
|
|
815
818
|
.requestWithdraw(amount, withdrawUnit)
|
|
816
819
|
.accounts(accounts)
|
|
817
820
|
.remainingAccounts(remainingAccounts)
|