@zebec-network/zebec-vault-sdk 5.2.5 → 5.3.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/dist/service.d.ts +2 -2
- package/dist/service.js +5 -3
- package/dist/types.d.ts +1 -0
- package/package.json +5 -4
package/dist/service.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type ZebecStakeIdlV1 } from "@zebec-network/zebec-stake-sdk";
|
|
|
6
6
|
import { type ZebecStreamIdl } from "@zebec-network/zebec-stream-sdk";
|
|
7
7
|
import { type ZebecVaultV1Idl } from "./artifacts";
|
|
8
8
|
import type { RpcNetwork } from "./constants";
|
|
9
|
-
import type { CancelStreamParams, ChangeStreamReceiverParams,
|
|
9
|
+
import type { CancelStreamParams, ChangeStreamReceiverParams, CreateSilverCardInstructionData, CreateSilverCardParams, CreateStreamFromVaultParams, createMultipleStreamFromVaultParams, LoadCarbonCardInstructionData, LoadCarbonCardParams, Numeric, PauseResumeStreamParams, ProposalAction, ProposalInfo, StakeInstructionData, StakeUserNonceInfo, StreamMetadataInfo, SwapAndCreateSilverCardParams, SwapAndLoadCarbonCardParams, TokenFeeRecord, VaultInfo, WithdrawStreamParams } from "./types";
|
|
10
10
|
export declare class ZebecVaultService {
|
|
11
11
|
readonly provider: Provider;
|
|
12
12
|
readonly vaultV1Program: Program<ZebecVaultV1Idl>;
|
|
@@ -126,7 +126,7 @@ export declare class ZebecVaultService {
|
|
|
126
126
|
}): Promise<TransactionInstruction>;
|
|
127
127
|
getPauseResumeStreamInstruction(streamMetadata: PublicKey, user: PublicKey): Promise<TransactionInstruction>;
|
|
128
128
|
getCancelStreamInstruction(feePayer: PublicKey, otherParty: PublicKey, otherPartyAta: PublicKey, signer: PublicKey, signerAta: PublicKey, streamMetadata: PublicKey, streamToken: PublicKey, streamVault: PublicKey, streamVaultAta: PublicKey): Promise<TransactionInstruction>;
|
|
129
|
-
getWithdrawStreamInstruction(receiver: PublicKey, receiverAta: PublicKey, streamMetadata: PublicKey, streamToken: PublicKey, streamVault: PublicKey, streamVaultAta: PublicKey, withdrawer: PublicKey, feePayer: PublicKey): Promise<TransactionInstruction>;
|
|
129
|
+
getWithdrawStreamInstruction(receiver: PublicKey, receiverAta: PublicKey, streamMetadata: PublicKey, streamConfig: PublicKey, streamToken: PublicKey, streamVault: PublicKey, streamVaultAta: PublicKey, withdrawer: PublicKey, feePayer: PublicKey): Promise<TransactionInstruction>;
|
|
130
130
|
getChangeStreamReceiverInstruction(streamMetadata: PublicKey, newRecipient: PublicKey, signer: PublicKey): Promise<TransactionInstruction>;
|
|
131
131
|
getTransferFeesForStreamInstruction(feeVault: PublicKey, tokenMint: PublicKey, vaultOwner: PublicKey, feeVaultTokenAccount: PublicKey, vault: PublicKey, vaultSigner: PublicKey, vaultSignerTokenAccount: PublicKey, data: {
|
|
132
132
|
decimals: number;
|
package/dist/service.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ZebecVaultService = void 0;
|
|
4
|
-
const bignumber_js_1 = require("bignumber.js");
|
|
5
4
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
6
5
|
const spl_token_1 = require("@solana/spl-token");
|
|
7
6
|
const web3_js_1 = require("@solana/web3.js");
|
|
@@ -10,6 +9,7 @@ const solana_common_1 = require("@zebec-network/solana-common");
|
|
|
10
9
|
const zebec_card_v2_sdk_1 = require("@zebec-network/zebec-card-v2-sdk");
|
|
11
10
|
const zebec_stake_sdk_1 = require("@zebec-network/zebec-stake-sdk");
|
|
12
11
|
const zebec_stream_sdk_1 = require("@zebec-network/zebec-stream-sdk");
|
|
12
|
+
const bignumber_js_1 = require("bignumber.js");
|
|
13
13
|
const artifacts_1 = require("./artifacts");
|
|
14
14
|
const errors_1 = require("./errors");
|
|
15
15
|
const pda_1 = require("./pda");
|
|
@@ -1038,7 +1038,7 @@ class ZebecVaultService {
|
|
|
1038
1038
|
})
|
|
1039
1039
|
.instruction();
|
|
1040
1040
|
}
|
|
1041
|
-
async getWithdrawStreamInstruction(receiver, receiverAta, streamMetadata, streamToken, streamVault, streamVaultAta, withdrawer, feePayer) {
|
|
1041
|
+
async getWithdrawStreamInstruction(receiver, receiverAta, streamMetadata, streamConfig, streamToken, streamVault, streamVaultAta, withdrawer, feePayer) {
|
|
1042
1042
|
return this.streamProgram.methods
|
|
1043
1043
|
.withdrawStream()
|
|
1044
1044
|
.accountsPartial({
|
|
@@ -1050,6 +1050,7 @@ class ZebecVaultService {
|
|
|
1050
1050
|
receiverAta,
|
|
1051
1051
|
withdrawer,
|
|
1052
1052
|
feePayer,
|
|
1053
|
+
streamConfig,
|
|
1053
1054
|
})
|
|
1054
1055
|
.instruction();
|
|
1055
1056
|
}
|
|
@@ -1369,6 +1370,7 @@ class ZebecVaultService {
|
|
|
1369
1370
|
}
|
|
1370
1371
|
const [vault] = (0, pda_1.deriveUserVault)(vaultOwner, this.vaultV1ProgramId);
|
|
1371
1372
|
const [vaultSigner] = (0, pda_1.deriveVaultSigner)(vault, this.vaultV1ProgramId);
|
|
1373
|
+
const [streamConfig] = (0, zebec_stream_sdk_1.deriveStreamConfigPda)(params.streamConfigName, this.streamProgramId);
|
|
1372
1374
|
const feePayer = vaultOwner;
|
|
1373
1375
|
const withdrawer = vaultSigner;
|
|
1374
1376
|
const streamMetadata = (0, anchor_1.translateAddress)(params.streamMetadata);
|
|
@@ -1377,7 +1379,7 @@ class ZebecVaultService {
|
|
|
1377
1379
|
const vaultSignerAta = (0, solana_common_1.getAssociatedTokenAddressSync)(streamToken, vaultSigner, true);
|
|
1378
1380
|
const [streamVault] = (0, zebec_stream_sdk_1.deriveStreamVaultPda)(streamMetadata, this.streamProgramId);
|
|
1379
1381
|
const streamVaultAta = (0, solana_common_1.getAssociatedTokenAddressSync)(streamToken, streamVault, true);
|
|
1380
|
-
const ix = await this.getWithdrawStreamInstruction(vaultSigner, vaultSignerAta, streamMetadata, streamToken, streamVault, streamVaultAta, withdrawer, feePayer);
|
|
1382
|
+
const ix = await this.getWithdrawStreamInstruction(vaultSigner, vaultSignerAta, streamMetadata, streamConfig, streamToken, streamVault, streamVaultAta, withdrawer, feePayer);
|
|
1381
1383
|
const actions = [(0, utils_1.transactionInstructionToPropoalAction)(ix)];
|
|
1382
1384
|
const remainingAccounts = actions.reduce((acc, current) => {
|
|
1383
1385
|
const accounts = current.accountSpecs.map((spec) => ({
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@zebec-network/solana-common": "^2.3.1",
|
|
10
10
|
"@zebec-network/zebec-card-v2-sdk": "^2.6.0",
|
|
11
11
|
"@zebec-network/zebec-stake-sdk": "^1.3.1",
|
|
12
|
-
"@zebec-network/zebec-stream-sdk": "^3.3.
|
|
12
|
+
"@zebec-network/zebec-stream-sdk": "^3.3.1",
|
|
13
13
|
"bignumber.js": "^9.3.1",
|
|
14
14
|
"buffer": "^6.0.3"
|
|
15
15
|
},
|
|
@@ -43,9 +43,10 @@
|
|
|
43
43
|
"build": "npm run clean && tsc",
|
|
44
44
|
"clean": "rimraf ./dist",
|
|
45
45
|
"format": "npx @biomejs/biome format --write ",
|
|
46
|
-
"
|
|
46
|
+
"prepare": "npm run build",
|
|
47
|
+
"test": "ts-mocha -p ./tsconfig.json -b -t 1000000000 test/**/*.test.ts",
|
|
47
48
|
"test:single": "ts-mocha -p ./tsconfig.json -t 1000000000"
|
|
48
49
|
},
|
|
49
50
|
"types": "dist/index.d.ts",
|
|
50
|
-
"version": "5.
|
|
51
|
-
}
|
|
51
|
+
"version": "5.3.0"
|
|
52
|
+
}
|