@zebec-network/zebec-stream-sdk 3.1.2 → 3.2.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.
@@ -58,7 +58,7 @@ export declare class ZebecStreamService {
58
58
  }): Promise<TransactionInstruction>;
59
59
  getPauseResumeStreamInstruction(streamMetadata: PublicKey, user: PublicKey): Promise<TransactionInstruction>;
60
60
  getCancelStreamInstruction(feePayer: PublicKey, otherParty: PublicKey, otherPartyAta: PublicKey, signer: PublicKey, signerAta: PublicKey, streamMetadata: PublicKey, streamToken: PublicKey, streamVault: PublicKey, streamVaultAta: PublicKey): Promise<TransactionInstruction>;
61
- getWithdrawStreamInstruction(receiver: PublicKey, receiverAta: PublicKey, streamMetadata: PublicKey, streamToken: PublicKey, streamVault: PublicKey, streamVaultAta: PublicKey, withdrawer: PublicKey, feePayer: PublicKey): Promise<TransactionInstruction>;
61
+ getWithdrawStreamInstruction(receiver: PublicKey, receiverAta: PublicKey, streamConfig: PublicKey, streamMetadata: PublicKey, streamToken: PublicKey, streamVault: PublicKey, streamVaultAta: PublicKey, withdrawer: PublicKey, feePayer: PublicKey): Promise<TransactionInstruction>;
62
62
  getWhitelistTokensInstruction(admin: PublicKey, streamConfig: PublicKey, tokens: PublicKey[]): Promise<TransactionInstruction>;
63
63
  getChangeStreamReceiverInstruction(streamMetadata: PublicKey, newRecipient: PublicKey, signer: PublicKey): Promise<TransactionInstruction>;
64
64
  initializeStreamConfig(params: InitializeStreamConfigParams): Promise<TransactionPayload>;
@@ -160,7 +160,7 @@ class ZebecStreamService {
160
160
  })
161
161
  .instruction();
162
162
  }
163
- async getWithdrawStreamInstruction(receiver, receiverAta, streamMetadata, streamToken, streamVault, streamVaultAta, withdrawer, feePayer) {
163
+ async getWithdrawStreamInstruction(receiver, receiverAta, streamConfig, streamMetadata, streamToken, streamVault, streamVaultAta, withdrawer, feePayer) {
164
164
  return this.program.methods
165
165
  .withdrawStream()
166
166
  .accountsPartial({
@@ -172,6 +172,7 @@ class ZebecStreamService {
172
172
  receiverAta,
173
173
  withdrawer,
174
174
  feePayer,
175
+ streamConfig,
175
176
  })
176
177
  .instruction();
177
178
  }
@@ -360,6 +361,7 @@ class ZebecStreamService {
360
361
  return this._createPayload(user, [ix]);
361
362
  }
362
363
  async withdrawStream(params) {
364
+ const [streamConfig] = (0, pda_1.deriveStreamConfigPda)(this.streamConfigName, this.programId);
363
365
  const receiver = (0, anchor_1.translateAddress)(params.receiver);
364
366
  const withdrawer = params.withdrawer
365
367
  ? (0, anchor_1.translateAddress)(params.withdrawer)
@@ -375,7 +377,7 @@ class ZebecStreamService {
375
377
  const receiverAta = (0, solana_common_1.getAssociatedTokenAddressSync)(streamToken, receiver, true);
376
378
  const [streamVault] = (0, pda_1.deriveStreamVaultPda)(streamMetadata, this.programId);
377
379
  const streamVaultAta = (0, solana_common_1.getAssociatedTokenAddressSync)(streamToken, streamVault, true);
378
- const ix = await this.getWithdrawStreamInstruction(receiver, receiverAta, streamMetadata, streamToken, streamVault, streamVaultAta, withdrawer, feePayer);
380
+ const ix = await this.getWithdrawStreamInstruction(receiver, receiverAta, streamConfig, streamMetadata, streamToken, streamVault, streamVaultAta, withdrawer, feePayer);
379
381
  return this._createPayload(withdrawer, [ix]);
380
382
  }
381
383
  async whiteListTokens(params) {
package/package.json CHANGED
@@ -1,44 +1,44 @@
1
1
  {
2
- "author": "Ashish Sapkota",
3
- "dependencies": {
4
- "@coral-xyz/anchor": "^0.31.1",
5
- "@metaplex-foundation/mpl-token-metadata": "^3.4.0",
6
- "@metaplex-foundation/umi": "^1.4.1",
7
- "@metaplex-foundation/umi-bundle-defaults": "^1.4.1",
8
- "@metaplex-foundation/umi-web3js-adapters": "^1.4.1",
9
- "@solana/spl-token": "^0.4.14",
10
- "@solana/web3.js": "^1.98.2",
11
- "@zebec-network/core-utils": "^1.1.1",
12
- "@zebec-network/solana-common": "^2.3.1",
13
- "bignumber.js": "^9.3.1"
14
- },
15
- "description": "This is an SDK for interacting with ZEBEC Stream Program in solana",
16
- "devDependencies": {
17
- "@types/bn.js": "^5.2.0",
18
- "@types/mocha": "^10.0.10",
19
- "@types/node": "^24.3.1",
20
- "dotenv": "^17.2.3",
21
- "mocha": "^11.7.5",
22
- "prettier": "^3.7.4",
23
- "rimraf": "^6.1.2",
24
- "ts-mocha": "^11.1.0",
25
- "ts-node": "^10.9.2",
26
- "typescript": "^5.9.2"
27
- },
28
- "files": [
29
- "dist"
30
- ],
31
- "license": "MIT",
32
- "main": "dist/index.js",
33
- "name": "@zebec-network/zebec-stream-sdk",
34
- "scripts": {
35
- "build": "npm run clean && tsc",
36
- "clean": "rimraf ./dist",
37
- "format": "npx @biomejs/biome format --write",
38
- "start": "ts-node src/index.ts",
39
- "test": "ts-mocha -p ./tsconfig.json -t 1000000000 test/**/*.test.ts",
40
- "test:single": "ts-mocha -p ./tsconfig.json -t 1000000000"
41
- },
42
- "types": "dist/index.d.ts",
43
- "version": "3.1.2"
44
- }
2
+ "author": "Ashish Sapkota",
3
+ "dependencies": {
4
+ "@coral-xyz/anchor": "^0.31.1",
5
+ "@metaplex-foundation/mpl-token-metadata": "^3.4.0",
6
+ "@metaplex-foundation/umi": "^1.4.1",
7
+ "@metaplex-foundation/umi-bundle-defaults": "^1.4.1",
8
+ "@metaplex-foundation/umi-web3js-adapters": "^1.4.1",
9
+ "@solana/spl-token": "^0.4.14",
10
+ "@solana/web3.js": "^1.98.2",
11
+ "@zebec-network/core-utils": "^1.1.1",
12
+ "@zebec-network/solana-common": "^2.3.1",
13
+ "bignumber.js": "^9.3.1"
14
+ },
15
+ "description": "This is an SDK for interacting with ZEBEC Stream Program in solana",
16
+ "devDependencies": {
17
+ "@types/bn.js": "^5.2.0",
18
+ "@types/mocha": "^10.0.10",
19
+ "@types/node": "^24.3.1",
20
+ "dotenv": "^17.2.3",
21
+ "mocha": "^11.7.5",
22
+ "prettier": "^3.7.4",
23
+ "rimraf": "^6.1.2",
24
+ "ts-mocha": "^11.1.0",
25
+ "ts-node": "^10.9.2",
26
+ "typescript": "^5.9.2"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "license": "MIT",
32
+ "main": "dist/index.js",
33
+ "name": "@zebec-network/zebec-stream-sdk",
34
+ "scripts": {
35
+ "build": "npm run clean && tsc",
36
+ "clean": "rimraf ./dist",
37
+ "format": "npx @biomejs/biome format --write",
38
+ "start": "ts-node src/index.ts",
39
+ "test": "ts-mocha -p ./tsconfig.json -t 1000000000 test/**/*.test.ts",
40
+ "test:single": "ts-mocha -p ./tsconfig.json -t 1000000000"
41
+ },
42
+ "types": "dist/index.d.ts",
43
+ "version": "3.2.0"
44
+ }