@streamflow/stream 3.0.5 → 3.0.6

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/Stream.js CHANGED
@@ -410,7 +410,7 @@ var Stream = /** @class */ (function () {
410
410
  if (!(escrow === null || escrow === void 0 ? void 0 : escrow.data)) {
411
411
  throw new Error("Couldn't get account info.");
412
412
  }
413
- return [2 /*return*/, new types_1.Contract((0, utils_1.decodeStream)(escrow === null || escrow === void 0 ? void 0 : escrow.data))];
413
+ return [2 /*return*/, (0, utils_1.formatDecodedStream)((0, utils_1.decodeStream)(escrow === null || escrow === void 0 ? void 0 : escrow.data))];
414
414
  }
415
415
  });
416
416
  });
@@ -454,7 +454,7 @@ var Stream = /** @class */ (function () {
454
454
  streams = {};
455
455
  accounts.forEach(function (account) {
456
456
  var _a;
457
- var decoded = new types_1.Contract((0, utils_1.decodeStream)(account.account.data));
457
+ var decoded = (0, utils_1.formatDecodedStream)((0, utils_1.decodeStream)(account.account.data));
458
458
  streams = __assign(__assign({}, streams), (_a = {}, _a[account.pubkey.toBase58()] = decoded, _a));
459
459
  });
460
460
  sortedStreams = Object.entries(streams).sort(function (_a, _b) {
@@ -97,7 +97,6 @@ var utils_1 = require("./utils");
97
97
  var constants_1 = require("./constants");
98
98
  var instructions_1 = require("./instructions");
99
99
  var common_1 = require("@project-serum/common");
100
- var bs58_1 = require("@project-serum/anchor/dist/cjs/utils/bytes/bs58");
101
100
  var StreamClient = /** @class */ (function () {
102
101
  /**
103
102
  * Create Stream instance
@@ -248,8 +247,8 @@ var StreamClient = /** @class */ (function () {
248
247
  */
249
248
  StreamClient.prototype.createMultiple = function (data) {
250
249
  return __awaiter(this, void 0, void 0, function () {
251
- var sender, recipientsData, metadatas, metadataToRecipient, errors, signatures, chunkSize, chunkes, batch, recipientsData_1, recipientsData_1_1, recipientData, _a, tx, metadata, metadataPubKey, e_1_1, i, chunk, chunkes_1, chunkes_1_1, chunk, signed_batch, batchTransactionsCalls, responses, successes, failures, e_2_1;
252
- var e_1, _b, e_2, _c;
250
+ var sender, recipientsData, metadatas, metadataToRecipient, errors, signatures, chunkSize, chunkes, i, chunk, chunkes_1, chunkes_1_1, chunk, batch, chunk_1, chunk_1_1, recipientData, _a, tx, metadata, metadataPubKey, e_1_1, signed_batch, batchTransactionsCalls, responses, successes, failures, e_2_1;
251
+ var e_2, _b, e_1, _c;
253
252
  var _this = this;
254
253
  return __generator(this, function (_d) {
255
254
  switch (_d.label) {
@@ -259,53 +258,52 @@ var StreamClient = /** @class */ (function () {
259
258
  metadataToRecipient = {};
260
259
  errors = [];
261
260
  signatures = [];
262
- chunkSize = 100;
261
+ chunkSize = 10;
263
262
  chunkes = [];
264
- batch = [];
263
+ for (i = 0; i < recipientsData.length; i += chunkSize) {
264
+ chunk = recipientsData.slice(i, i + chunkSize);
265
+ chunkes.push(chunk);
266
+ }
265
267
  _d.label = 1;
266
268
  case 1:
267
- _d.trys.push([1, 6, 7, 8]);
268
- recipientsData_1 = __values(recipientsData), recipientsData_1_1 = recipientsData_1.next();
269
+ _d.trys.push([1, 16, 17, 18]);
270
+ chunkes_1 = __values(chunkes), chunkes_1_1 = chunkes_1.next();
269
271
  _d.label = 2;
270
272
  case 2:
271
- if (!!recipientsData_1_1.done) return [3 /*break*/, 5];
272
- recipientData = recipientsData_1_1.value;
273
- return [4 /*yield*/, this.prepareStreamTransaction(recipientData, data)];
273
+ if (!!chunkes_1_1.done) return [3 /*break*/, 15];
274
+ chunk = chunkes_1_1.value;
275
+ batch = [];
276
+ _d.label = 3;
274
277
  case 3:
278
+ _d.trys.push([3, 8, 9, 10]);
279
+ chunk_1 = (e_1 = void 0, __values(chunk)), chunk_1_1 = chunk_1.next();
280
+ _d.label = 4;
281
+ case 4:
282
+ if (!!chunk_1_1.done) return [3 /*break*/, 7];
283
+ recipientData = chunk_1_1.value;
284
+ return [4 /*yield*/, this.prepareStreamTransaction(recipientData, data)];
285
+ case 5:
275
286
  _a = _d.sent(), tx = _a.tx, metadata = _a.metadata;
276
287
  metadataPubKey = metadata.publicKey.toBase58();
277
288
  metadataToRecipient[metadataPubKey] = recipientData;
278
289
  metadatas.push(metadata);
279
290
  batch.push({ tx: tx, recipient: recipientData.recipient });
280
- _d.label = 4;
281
- case 4:
282
- recipientsData_1_1 = recipientsData_1.next();
283
- return [3 /*break*/, 2];
284
- case 5: return [3 /*break*/, 8];
291
+ _d.label = 6;
285
292
  case 6:
293
+ chunk_1_1 = chunk_1.next();
294
+ return [3 /*break*/, 4];
295
+ case 7: return [3 /*break*/, 10];
296
+ case 8:
286
297
  e_1_1 = _d.sent();
287
298
  e_1 = { error: e_1_1 };
288
- return [3 /*break*/, 8];
289
- case 7:
299
+ return [3 /*break*/, 10];
300
+ case 9:
290
301
  try {
291
- if (recipientsData_1_1 && !recipientsData_1_1.done && (_b = recipientsData_1.return)) _b.call(recipientsData_1);
302
+ if (chunk_1_1 && !chunk_1_1.done && (_c = chunk_1.return)) _c.call(chunk_1);
292
303
  }
293
304
  finally { if (e_1) throw e_1.error; }
294
305
  return [7 /*endfinally*/];
295
- case 8:
296
- for (i = 0; i < batch.length; i += chunkSize) {
297
- chunk = batch.slice(i, i + chunkSize);
298
- chunkes.push(chunk);
299
- }
300
- _d.label = 9;
301
- case 9:
302
- _d.trys.push([9, 16, 17, 18]);
303
- chunkes_1 = __values(chunkes), chunkes_1_1 = chunkes_1.next();
304
- _d.label = 10;
305
- case 10:
306
- if (!!chunkes_1_1.done) return [3 /*break*/, 15];
307
- chunk = chunkes_1_1.value;
308
- return [4 /*yield*/, signAllTransactionWithRecipients(sender, chunk)];
306
+ case 10: return [4 /*yield*/, signAllTransactionWithRecipients(sender, batch)];
309
307
  case 11:
310
308
  signed_batch = _d.sent();
311
309
  batchTransactionsCalls = signed_batch.map(function (el) {
@@ -330,7 +328,7 @@ var StreamClient = /** @class */ (function () {
330
328
  _d.label = 14;
331
329
  case 14:
332
330
  chunkes_1_1 = chunkes_1.next();
333
- return [3 /*break*/, 10];
331
+ return [3 /*break*/, 2];
334
332
  case 15: return [3 /*break*/, 18];
335
333
  case 16:
336
334
  e_2_1 = _d.sent();
@@ -338,7 +336,7 @@ var StreamClient = /** @class */ (function () {
338
336
  return [3 /*break*/, 18];
339
337
  case 17:
340
338
  try {
341
- if (chunkes_1_1 && !chunkes_1_1.done && (_c = chunkes_1.return)) _c.call(chunkes_1);
339
+ if (chunkes_1_1 && !chunkes_1_1.done && (_b = chunkes_1.return)) _b.call(chunkes_1);
342
340
  }
343
341
  finally { if (e_2) throw e_2.error; }
344
342
  return [7 /*endfinally*/];
@@ -605,7 +603,7 @@ var StreamClient = /** @class */ (function () {
605
603
  if (!(escrow === null || escrow === void 0 ? void 0 : escrow.data)) {
606
604
  throw new Error("Couldn't get account info.");
607
605
  }
608
- return [2 /*return*/, new types_1.Contract((0, utils_1.decodeStream)(escrow === null || escrow === void 0 ? void 0 : escrow.data))];
606
+ return [2 /*return*/, (0, utils_1.formatDecodedStream)((0, utils_1.decodeStream)(escrow === null || escrow === void 0 ? void 0 : escrow.data))];
609
607
  }
610
608
  });
611
609
  });
@@ -627,10 +625,10 @@ var StreamClient = /** @class */ (function () {
627
625
  case 0:
628
626
  accounts = [];
629
627
  if (!(direction === "all")) return [3 /*break*/, 3];
630
- return [4 /*yield*/, getProgramAccounts(this.connection, wallet, constants_1.STREAM_STRUCT_OFFSET_SENDER, this.cluster)];
628
+ return [4 /*yield*/, getProgramAccounts(this.connection, wallet, constants_1.STREAM_STRUCT_OFFSET_SENDER, this.programId)];
631
629
  case 1:
632
630
  outgoingAccounts = _d.sent();
633
- return [4 /*yield*/, getProgramAccounts(this.connection, wallet, constants_1.STREAM_STRUCT_OFFSET_RECIPIENT, this.cluster)];
631
+ return [4 /*yield*/, getProgramAccounts(this.connection, wallet, constants_1.STREAM_STRUCT_OFFSET_RECIPIENT, this.programId)];
634
632
  case 2:
635
633
  incomingAccounts = _d.sent();
636
634
  accounts = __spreadArray(__spreadArray([], __read(outgoingAccounts), false), __read(incomingAccounts), false);
@@ -639,7 +637,7 @@ var StreamClient = /** @class */ (function () {
639
637
  offset = direction === "outgoing"
640
638
  ? constants_1.STREAM_STRUCT_OFFSET_SENDER
641
639
  : constants_1.STREAM_STRUCT_OFFSET_RECIPIENT;
642
- return [4 /*yield*/, getProgramAccounts(this.connection, wallet, offset, this.cluster)];
640
+ return [4 /*yield*/, getProgramAccounts(this.connection, wallet, offset, this.programId)];
643
641
  case 4:
644
642
  accounts = _d.sent();
645
643
  _d.label = 5;
@@ -647,7 +645,7 @@ var StreamClient = /** @class */ (function () {
647
645
  streams = {};
648
646
  accounts.forEach(function (account) {
649
647
  var _a;
650
- var decoded = new types_1.Contract((0, utils_1.decodeStream)(account.account.data));
648
+ var decoded = (0, utils_1.formatDecodedStream)((0, utils_1.decodeStream)(account.account.data));
651
649
  streams = __assign(__assign({}, streams), (_a = {}, _a[account.pubkey.toBase58()] = decoded, _a));
652
650
  });
653
651
  sortedStreams = Object.entries(streams).sort(function (_a, _b) {
@@ -762,13 +760,12 @@ var StreamClient = /** @class */ (function () {
762
760
  withdrawor: constants_1.WITHDRAWOR_PUBLIC_KEY,
763
761
  systemProgram: web3_js_1.SystemProgram.programId,
764
762
  }));
765
- return [4 /*yield*/, this.connection.getLatestBlockhash(commitment)];
763
+ return [4 /*yield*/, this.connection.getRecentBlockhash(commitment)];
766
764
  case 6:
767
765
  hash = _f.sent();
768
766
  tx = (_e = new web3_js_1.Transaction({
769
767
  feePayer: sender.publicKey,
770
- blockhash: hash.blockhash,
771
- lastValidBlockHeight: hash.lastValidBlockHeight,
768
+ recentBlockhash: hash.blockhash,
772
769
  })).add.apply(_e, __spreadArray([], __read(ixs), false));
773
770
  tx.partialSign(metadata);
774
771
  return [2 /*return*/, { tx: tx, metadata: metadata }];
@@ -779,11 +776,10 @@ var StreamClient = /** @class */ (function () {
779
776
  return StreamClient;
780
777
  }());
781
778
  exports.default = StreamClient;
782
- function getProgramAccounts(connection, wallet, offset, cluster) {
783
- if (cluster === void 0) { cluster = types_1.Cluster.Mainnet; }
779
+ function getProgramAccounts(connection, wallet, offset, programId) {
784
780
  return __awaiter(this, void 0, void 0, function () {
785
781
  return __generator(this, function (_a) {
786
- return [2 /*return*/, connection === null || connection === void 0 ? void 0 : connection.getProgramAccounts(new web3_js_1.PublicKey(constants_1.PROGRAM_ID[cluster]), {
782
+ return [2 /*return*/, connection === null || connection === void 0 ? void 0 : connection.getProgramAccounts(programId, {
787
783
  filters: [
788
784
  {
789
785
  memcmp: {
@@ -862,26 +858,18 @@ function signAllTransactionWithRecipients(sender, batch) {
862
858
  }
863
859
  function sendAndConfirmStreamRawTransaction(connection, batchItem) {
864
860
  return __awaiter(this, void 0, void 0, function () {
865
- var rawTx, _a, lastValidBlockHeight, signature, recentBlockhash, confirmationStrategy, completedTxSignature, error_1;
866
- return __generator(this, function (_b) {
867
- switch (_b.label) {
861
+ var rawTx, signature, error_1;
862
+ return __generator(this, function (_a) {
863
+ switch (_a.label) {
868
864
  case 0:
869
- _b.trys.push([0, 2, , 3]);
865
+ _a.trys.push([0, 2, , 3]);
870
866
  rawTx = batchItem.tx.serialize();
871
- _a = batchItem.tx, lastValidBlockHeight = _a.lastValidBlockHeight, signature = _a.signature, recentBlockhash = _a.recentBlockhash;
872
- if (!lastValidBlockHeight || !signature || !recentBlockhash)
873
- throw { recipient: batchItem.recipient, error: "no recent blockhash" };
874
- confirmationStrategy = {
875
- lastValidBlockHeight: lastValidBlockHeight,
876
- signature: (0, bs58_1.encode)(signature),
877
- blockhash: recentBlockhash,
878
- };
879
- return [4 /*yield*/, (0, web3_js_1.sendAndConfirmRawTransaction)(connection, rawTx, confirmationStrategy)];
867
+ return [4 /*yield*/, (0, web3_js_1.sendAndConfirmRawTransaction)(connection, rawTx)];
880
868
  case 1:
881
- completedTxSignature = _b.sent();
882
- return [2 /*return*/, __assign(__assign({}, batchItem), { signature: completedTxSignature })];
869
+ signature = _a.sent();
870
+ return [2 /*return*/, __assign(__assign({}, batchItem), { signature: signature })];
883
871
  case 2:
884
- error_1 = _b.sent();
872
+ error_1 = _a.sent();
885
873
  throw { recipient: batchItem.recipient, error: error_1 };
886
874
  case 3: return [2 /*return*/];
887
875
  }
@@ -120,7 +120,7 @@ beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
120
120
  connection = new web3.Connection(web3.clusterApiUrl(), "confirmed");
121
121
  sender = new anchor_1.Wallet(web3.Keypair.generate());
122
122
  recipient = new anchor_1.Wallet(web3.Keypair.generate());
123
- recipients = __spreadArray([], __read(new Array(10)), false).map(function () { return new anchor_1.Wallet(web3.Keypair.generate()); });
123
+ recipients = __spreadArray([], __read(new Array(30)), false).map(function () { return new anchor_1.Wallet(web3.Keypair.generate()); });
124
124
  return [4 /*yield*/, (0, airdrop_request_1.requestAirdrop)(sender, connection)];
125
125
  case 1:
126
126
  _a.sent();
@@ -211,7 +211,7 @@ exports.timePeriodOptions = [
211
211
  { value: exports.PERIOD.YEAR, label: "year" },
212
212
  ];
213
213
  test("Can create multiple stremas", function () { return __awaiter(void 0, void 0, void 0, function () {
214
- var now, recipientsPayload, values, data, response, errors;
214
+ var now, recipientsPayload, values, data, response;
215
215
  return __generator(this, function (_a) {
216
216
  switch (_a.label) {
217
217
  case 0:
@@ -242,8 +242,6 @@ test("Can create multiple stremas", function () { return __awaiter(void 0, void
242
242
  return [4 /*yield*/, (streamInstance === null || streamInstance === void 0 ? void 0 : streamInstance.createMultiple(data))];
243
243
  case 1:
244
244
  response = _a.sent();
245
- errors = response === null || response === void 0 ? void 0 : response.errors;
246
- console.log(errors);
247
245
  return [2 /*return*/, response];
248
246
  }
249
247
  });
package/dist/types.d.ts CHANGED
@@ -85,7 +85,7 @@ export interface WithdrawStreamParams extends WithdrawStreamData {
85
85
  cluster?: ClusterExtended;
86
86
  }
87
87
  export interface WithdrawParams extends WithdrawStreamData {
88
- invoker: Wallet | Keypair;
88
+ invoker: Wallet;
89
89
  }
90
90
  export interface TopupStreamData {
91
91
  id: string;
@@ -97,7 +97,7 @@ export interface TopupStreamParams extends TopupStreamData {
97
97
  cluster?: ClusterExtended;
98
98
  }
99
99
  export interface TopupParams extends TopupStreamData {
100
- invoker: Wallet | Keypair;
100
+ invoker: Wallet;
101
101
  }
102
102
  export interface CancelStreamData {
103
103
  id: string;
@@ -108,7 +108,7 @@ export interface CancelStreamParams extends CancelStreamData {
108
108
  cluster?: ClusterExtended;
109
109
  }
110
110
  export interface CancelParams extends CancelStreamData {
111
- invoker: Wallet | Keypair;
111
+ invoker: Wallet;
112
112
  }
113
113
  export interface TransferStreamData {
114
114
  id: string;
@@ -120,7 +120,7 @@ export interface TransferStreamParams extends TransferStreamData {
120
120
  cluster?: ClusterExtended;
121
121
  }
122
122
  export interface TransferParams extends TransferStreamData {
123
- invoker: Wallet | Keypair;
123
+ invoker: Wallet;
124
124
  }
125
125
  export interface GetStreamParams {
126
126
  connection: Connection;
@@ -176,49 +176,6 @@ export interface Stream {
176
176
  canTopup: boolean;
177
177
  name: string;
178
178
  withdrawalFrequency: number;
179
- unlocked(currentTimestamp: number, decimals: number): number;
180
- }
181
- export declare class Contract implements Stream {
182
- magic: number;
183
- version: number;
184
- createdAt: number;
185
- withdrawnAmount: BN;
186
- canceledAt: number;
187
- end: number;
188
- lastWithdrawnAt: number;
189
- sender: string;
190
- senderTokens: string;
191
- recipient: string;
192
- recipientTokens: string;
193
- mint: string;
194
- escrowTokens: string;
195
- streamflowTreasury: string;
196
- streamflowTreasuryTokens: string;
197
- streamflowFeeTotal: BN;
198
- streamflowFeeWithdrawn: BN;
199
- streamflowFeePercent: number;
200
- partnerFeeTotal: BN;
201
- partnerFeeWithdrawn: BN;
202
- partnerFeePercent: number;
203
- partner: string;
204
- partnerTokens: string;
205
- start: number;
206
- depositedAmount: BN;
207
- period: number;
208
- amountPerPeriod: BN;
209
- cliff: number;
210
- cliffAmount: BN;
211
- cancelableBySender: boolean;
212
- cancelableByRecipient: boolean;
213
- automaticWithdrawal: boolean;
214
- transferableBySender: boolean;
215
- transferableByRecipient: boolean;
216
- canTopup: boolean;
217
- name: string;
218
- withdrawalFrequency: number;
219
- constructor(stream: DecodedStream);
220
- unlocked(currentTimestamp: number, decimals: number): number;
221
- remaining(decimals: number): number;
222
179
  }
223
180
  export interface DecodedStream {
224
181
  magic: BN;
package/dist/types.js CHANGED
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TransferCancelOptions = exports.Contract = exports.LocalCluster = exports.StreamType = exports.StreamDirection = exports.Cluster = void 0;
7
- var bn_js_1 = __importDefault(require("bn.js"));
8
- var utils_1 = require("./utils");
3
+ exports.TransferCancelOptions = exports.LocalCluster = exports.StreamType = exports.StreamDirection = exports.Cluster = void 0;
9
4
  var wallet_adapter_base_1 = require("@solana/wallet-adapter-base");
10
5
  Object.defineProperty(exports, "Cluster", { enumerable: true, get: function () { return wallet_adapter_base_1.WalletAdapterNetwork; } });
11
6
  var StreamDirection;
@@ -24,64 +19,6 @@ var LocalCluster;
24
19
  (function (LocalCluster) {
25
20
  LocalCluster["Local"] = "local";
26
21
  })(LocalCluster = exports.LocalCluster || (exports.LocalCluster = {}));
27
- var Contract = /** @class */ (function () {
28
- function Contract(stream) {
29
- var _a;
30
- this.magic = stream.magic.toNumber();
31
- this.version = stream.version.toNumber();
32
- this.createdAt = stream.createdAt.toNumber();
33
- this.withdrawnAmount = stream.withdrawnAmount;
34
- this.canceledAt = stream.canceledAt.toNumber();
35
- this.end = stream.end.toNumber();
36
- this.lastWithdrawnAt = stream.lastWithdrawnAt.toNumber();
37
- this.sender = stream.sender.toBase58();
38
- this.senderTokens = stream.senderTokens.toBase58();
39
- this.recipient = stream.recipient.toBase58();
40
- this.recipientTokens = stream.recipientTokens.toBase58();
41
- this.mint = stream.mint.toBase58();
42
- this.escrowTokens = stream.escrowTokens.toBase58();
43
- this.streamflowTreasury = stream.streamflowTreasury.toBase58();
44
- this.streamflowTreasuryTokens =
45
- stream.streamflowTreasuryTokens.toBase58();
46
- this.streamflowFeeTotal = stream.streamflowFeeTotal;
47
- this.streamflowFeeWithdrawn = stream.streamflowFeeWithdrawn;
48
- this.streamflowFeePercent = stream.streamflowFeePercent.toNumber();
49
- this.partnerFeeTotal = stream.partnerFeeTotal;
50
- this.partnerFeeWithdrawn = stream.partnerFeeWithdrawn;
51
- this.partnerFeePercent = stream.partnerFeePercent.toNumber();
52
- this.partner = stream.partner.toBase58();
53
- this.partnerTokens = (_a = stream.partnerTokens) === null || _a === void 0 ? void 0 : _a.toBase58();
54
- this.start = stream.start.toNumber();
55
- this.depositedAmount = stream.depositedAmount;
56
- this.period = stream.period.toNumber();
57
- this.amountPerPeriod = stream.amountPerPeriod;
58
- this.cliff = stream.cliff.toNumber();
59
- this.cliffAmount = stream.cliffAmount;
60
- this.cancelableBySender = stream.cancelableBySender;
61
- this.cancelableByRecipient = stream.cancelableByRecipient;
62
- this.automaticWithdrawal = stream.automaticWithdrawal;
63
- this.transferableBySender = stream.transferableBySender;
64
- this.transferableByRecipient = stream.transferableByRecipient;
65
- this.canTopup = stream.canTopup;
66
- this.name = stream.name;
67
- this.withdrawalFrequency = stream.withdrawFrequency.toNumber();
68
- }
69
- Contract.prototype.unlocked = function (currentTimestamp, decimals) {
70
- var deposited = (0, utils_1.getNumberFromBN)(this.depositedAmount, decimals);
71
- if (currentTimestamp < this.cliff)
72
- return 0;
73
- if (currentTimestamp > this.end)
74
- return deposited;
75
- var streamedBN = this.cliffAmount.add(new bn_js_1.default(Math.floor((currentTimestamp - this.cliff) / this.period)).mul(this.amountPerPeriod));
76
- var streamed = (0, utils_1.getNumberFromBN)(streamedBN, decimals);
77
- return streamed < deposited ? streamed : deposited;
78
- };
79
- Contract.prototype.remaining = function (decimals) {
80
- return (0, utils_1.getNumberFromBN)(this.depositedAmount.sub(this.withdrawnAmount), decimals);
81
- };
82
- return Contract;
83
- }());
84
- exports.Contract = Contract;
85
22
  var TransferCancelOptions;
86
23
  (function (TransferCancelOptions) {
87
24
  TransferCancelOptions["Recipient"] = "recipient";
package/dist/utils.js CHANGED
@@ -52,11 +52,9 @@ var decodeStream = function (buf) {
52
52
  };
53
53
  };
54
54
  exports.decodeStream = decodeStream;
55
- // DeprecationWarning: This object will be deprecated starting from the version 4.0.0. Use
56
- // types/Contract instead
57
55
  var formatDecodedStream = function (stream) {
58
56
  var _a;
59
- var resp = {
57
+ return ({
60
58
  magic: stream.magic.toNumber(),
61
59
  version: stream.version.toNumber(),
62
60
  createdAt: stream.createdAt.toNumber(),
@@ -94,10 +92,7 @@ var formatDecodedStream = function (stream) {
94
92
  canTopup: stream.canTopup,
95
93
  name: stream.name,
96
94
  withdrawalFrequency: stream.withdrawFrequency.toNumber(),
97
- unlocked: function () { return 0; },
98
- withdrawn: function () { return new bn_js_1.default(0); } //phantom method to preserve partial support of this object
99
- };
100
- return resp;
95
+ });
101
96
  };
102
97
  exports.formatDecodedStream = formatDecodedStream;
103
98
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/stream",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "JavaScript SDK to interact with Streamflow protocol.",
5
5
  "main": "dist/index.js",
6
6
  "homepage": "https://github.com/streamflow-finance/js-sdk/",
@@ -20,7 +20,7 @@
20
20
  "@project-serum/common": "^0.0.1-beta.3",
21
21
  "@solana/spl-token": "^0.1.8",
22
22
  "@solana/wallet-adapter-base": "^0.9.2",
23
- "@solana/web3.js": "^1.42.0",
23
+ "@solana/web3.js": "^1.29.2",
24
24
  "bn.js": "^5.2.0",
25
25
  "buffer-layout": "^1.2.1"
26
26
  }