@drift-labs/vaults-sdk 0.2.21 → 0.2.23
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 +1 -1
- package/lib/vaultClient.js +5 -5
- package/package.json +2 -2
- package/src/vaultClient.ts +10 -5
package/lib/vaultClient.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ export declare class VaultClient {
|
|
|
153
153
|
* @param authority the authority allowed to make deposits into the vault
|
|
154
154
|
* @returns
|
|
155
155
|
*/
|
|
156
|
-
initializeVaultDepositor(vault: PublicKey, authority?: PublicKey): Promise<TransactionSignature>;
|
|
156
|
+
initializeVaultDepositor(vault: PublicKey, authority?: PublicKey, payer?: PublicKey): Promise<TransactionSignature>;
|
|
157
157
|
initializeTokenizedVaultDepositor(params: {
|
|
158
158
|
vault: PublicKey;
|
|
159
159
|
tokenName: string;
|
package/lib/vaultClient.js
CHANGED
|
@@ -637,7 +637,7 @@ class VaultClient {
|
|
|
637
637
|
await this.getApplyRebaseTokenizedDepositorIx(vault, tokenizedVaultDepositor),
|
|
638
638
|
]);
|
|
639
639
|
}
|
|
640
|
-
createInitVaultDepositorIx(vault, authority) {
|
|
640
|
+
createInitVaultDepositorIx(vault, authority, payer) {
|
|
641
641
|
const vaultDepositor = (0, addresses_1.getVaultDepositorAddressSync)(this.program.programId, vault, authority || this.driftClient.wallet.publicKey);
|
|
642
642
|
const accounts = {
|
|
643
643
|
vaultDepositor,
|
|
@@ -647,7 +647,7 @@ class VaultClient {
|
|
|
647
647
|
const initIx = this.program.instruction.initializeVaultDepositor({
|
|
648
648
|
accounts: {
|
|
649
649
|
...accounts,
|
|
650
|
-
payer: authority || this.driftClient.wallet.publicKey,
|
|
650
|
+
payer: payer || authority || this.driftClient.wallet.publicKey,
|
|
651
651
|
rent: web3_js_1.SYSVAR_RENT_PUBKEY,
|
|
652
652
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
653
653
|
},
|
|
@@ -660,7 +660,7 @@ class VaultClient {
|
|
|
660
660
|
* @param authority the authority allowed to make deposits into the vault
|
|
661
661
|
* @returns
|
|
662
662
|
*/
|
|
663
|
-
async initializeVaultDepositor(vault, authority) {
|
|
663
|
+
async initializeVaultDepositor(vault, authority, payer) {
|
|
664
664
|
const vaultDepositor = (0, addresses_1.getVaultDepositorAddressSync)(this.program.programId, vault, authority || this.driftClient.wallet.publicKey);
|
|
665
665
|
const accounts = {
|
|
666
666
|
vaultDepositor,
|
|
@@ -672,14 +672,14 @@ class VaultClient {
|
|
|
672
672
|
.initializeVaultDepositor()
|
|
673
673
|
.accounts({
|
|
674
674
|
...accounts,
|
|
675
|
-
payer: authority || this.driftClient.wallet.publicKey,
|
|
675
|
+
payer: payer || authority || this.driftClient.wallet.publicKey,
|
|
676
676
|
rent: web3_js_1.SYSVAR_RENT_PUBKEY,
|
|
677
677
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
678
678
|
})
|
|
679
679
|
.rpc();
|
|
680
680
|
}
|
|
681
681
|
else {
|
|
682
|
-
const initIx = this.createInitVaultDepositorIx(vault, authority);
|
|
682
|
+
const initIx = this.createInitVaultDepositorIx(vault, authority, payer);
|
|
683
683
|
return await this.createAndSendTxn([initIx]);
|
|
684
684
|
}
|
|
685
685
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drift-labs/vaults-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"directories": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@coral-xyz/anchor": "0.28.0",
|
|
11
|
-
"@drift-labs/sdk": "2.104.0-beta.
|
|
11
|
+
"@drift-labs/sdk": "2.104.0-beta.35",
|
|
12
12
|
"@ledgerhq/hw-app-solana": "7.2.4",
|
|
13
13
|
"@ledgerhq/hw-transport": "6.31.4",
|
|
14
14
|
"@ledgerhq/hw-transport-node-hid": "6.29.5",
|
package/src/vaultClient.ts
CHANGED
|
@@ -988,7 +988,11 @@ export class VaultClient {
|
|
|
988
988
|
]);
|
|
989
989
|
}
|
|
990
990
|
|
|
991
|
-
private createInitVaultDepositorIx(
|
|
991
|
+
private createInitVaultDepositorIx(
|
|
992
|
+
vault: PublicKey,
|
|
993
|
+
authority?: PublicKey,
|
|
994
|
+
payer?: PublicKey
|
|
995
|
+
) {
|
|
992
996
|
const vaultDepositor = getVaultDepositorAddressSync(
|
|
993
997
|
this.program.programId,
|
|
994
998
|
vault,
|
|
@@ -1004,7 +1008,7 @@ export class VaultClient {
|
|
|
1004
1008
|
const initIx = this.program.instruction.initializeVaultDepositor({
|
|
1005
1009
|
accounts: {
|
|
1006
1010
|
...accounts,
|
|
1007
|
-
payer: authority || this.driftClient.wallet.publicKey,
|
|
1011
|
+
payer: payer || authority || this.driftClient.wallet.publicKey,
|
|
1008
1012
|
rent: SYSVAR_RENT_PUBKEY,
|
|
1009
1013
|
systemProgram: SystemProgram.programId,
|
|
1010
1014
|
},
|
|
@@ -1021,7 +1025,8 @@ export class VaultClient {
|
|
|
1021
1025
|
*/
|
|
1022
1026
|
public async initializeVaultDepositor(
|
|
1023
1027
|
vault: PublicKey,
|
|
1024
|
-
authority?: PublicKey
|
|
1028
|
+
authority?: PublicKey,
|
|
1029
|
+
payer?: PublicKey
|
|
1025
1030
|
): Promise<TransactionSignature> {
|
|
1026
1031
|
const vaultDepositor = getVaultDepositorAddressSync(
|
|
1027
1032
|
this.program.programId,
|
|
@@ -1040,13 +1045,13 @@ export class VaultClient {
|
|
|
1040
1045
|
.initializeVaultDepositor()
|
|
1041
1046
|
.accounts({
|
|
1042
1047
|
...accounts,
|
|
1043
|
-
payer: authority || this.driftClient.wallet.publicKey,
|
|
1048
|
+
payer: payer || authority || this.driftClient.wallet.publicKey,
|
|
1044
1049
|
rent: SYSVAR_RENT_PUBKEY,
|
|
1045
1050
|
systemProgram: SystemProgram.programId,
|
|
1046
1051
|
})
|
|
1047
1052
|
.rpc();
|
|
1048
1053
|
} else {
|
|
1049
|
-
const initIx = this.createInitVaultDepositorIx(vault, authority);
|
|
1054
|
+
const initIx = this.createInitVaultDepositorIx(vault, authority, payer);
|
|
1050
1055
|
return await this.createAndSendTxn([initIx]);
|
|
1051
1056
|
}
|
|
1052
1057
|
}
|