@streamflow/stream 3.0.0-test.4 → 3.0.1

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.
@@ -45,8 +45,6 @@ export default class StreamClient {
45
45
  * @param {number} data.start - Timestamp (in seconds) when the stream/token vesting starts.
46
46
  * @param {number} data.period - Time step (period) in seconds per which the unlocking occurs.
47
47
  * @param {number} data.cliff - Vesting contract "cliff" timestamp in seconds.
48
- * @param {BN} data.cliffAmount - Amount unlocked at the "cliff".
49
- * @param {BN} data.amountPerPeriod - Amount unlocked per each period.
50
48
  * @param {boolean} data.canTopup - TRUE for streams, FALSE for vesting contracts.
51
49
  * @param {boolean} data.cancelableBySender - Whether or not sender can cancel the stream.
52
50
  * @param {boolean} data.cancelableByRecipient - Whether or not recipient can cancel the stream.
@@ -56,7 +54,7 @@ export default class StreamClient {
56
54
  * @param {number} [data.withdrawalFrequency = 0] - Relevant when automatic withdrawal is enabled. If greater than 0 our withdrawor will take care of withdrawals. If equal to 0 our withdrawor will skip, but everyone else can initiate withdrawals.
57
55
  * @param {string | null} [data.partner = null] - Partner's wallet address (optional).
58
56
  */
59
- createMultiple({ sender, recipientsData, mint, start, period, cliff, cliffAmount, amountPerPeriod, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, }: CreateMultiParams): Promise<CreateMultiResponse>;
57
+ createMultiple({ sender, recipientsData, mint, start, period, cliff, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, }: CreateMultiParams): Promise<CreateMultiResponse>;
60
58
  /**
61
59
  * Attempts withdrawal from the specified stream.
62
60
  * @param {WithdrawParams} data
@@ -228,8 +228,6 @@ var StreamClient = /** @class */ (function () {
228
228
  * @param {number} data.start - Timestamp (in seconds) when the stream/token vesting starts.
229
229
  * @param {number} data.period - Time step (period) in seconds per which the unlocking occurs.
230
230
  * @param {number} data.cliff - Vesting contract "cliff" timestamp in seconds.
231
- * @param {BN} data.cliffAmount - Amount unlocked at the "cliff".
232
- * @param {BN} data.amountPerPeriod - Amount unlocked per each period.
233
231
  * @param {boolean} data.canTopup - TRUE for streams, FALSE for vesting contracts.
234
232
  * @param {boolean} data.cancelableBySender - Whether or not sender can cancel the stream.
235
233
  * @param {boolean} data.cancelableByRecipient - Whether or not recipient can cancel the stream.
@@ -240,9 +238,9 @@ var StreamClient = /** @class */ (function () {
240
238
  * @param {string | null} [data.partner = null] - Partner's wallet address (optional).
241
239
  */
242
240
  StreamClient.prototype.createMultiple = function (_a) {
243
- var sender = _a.sender, recipientsData = _a.recipientsData, mint = _a.mint, start = _a.start, period = _a.period, cliff = _a.cliff, cliffAmount = _a.cliffAmount, amountPerPeriod = _a.amountPerPeriod, canTopup = _a.canTopup, cancelableBySender = _a.cancelableBySender, cancelableByRecipient = _a.cancelableByRecipient, transferableBySender = _a.transferableBySender, transferableByRecipient = _a.transferableByRecipient, _b = _a.automaticWithdrawal, automaticWithdrawal = _b === void 0 ? false : _b, _c = _a.withdrawalFrequency, withdrawalFrequency = _c === void 0 ? 0 : _c, _d = _a.partner, partner = _d === void 0 ? null : _d;
241
+ var sender = _a.sender, recipientsData = _a.recipientsData, mint = _a.mint, start = _a.start, period = _a.period, cliff = _a.cliff, canTopup = _a.canTopup, cancelableBySender = _a.cancelableBySender, cancelableByRecipient = _a.cancelableByRecipient, transferableBySender = _a.transferableBySender, transferableByRecipient = _a.transferableByRecipient, _b = _a.automaticWithdrawal, automaticWithdrawal = _b === void 0 ? false : _b, _c = _a.withdrawalFrequency, withdrawalFrequency = _c === void 0 ? 0 : _c, _d = _a.partner, partner = _d === void 0 ? null : _d;
244
242
  return __awaiter(this, void 0, void 0, function () {
245
- var mintPublicKey, batch, commitment, recipientsData_1, recipientsData_1_1, recipient, ixs, recipientPublicKey, metadata, _e, escrowTokens, senderTokens, recipientTokens, streamflowTreasuryTokens, partnerPublicKey, partnerTokens, hash, tx, e_1_1, signed_batch, sigs, i, buf, signature;
243
+ var mintPublicKey, batch, commitment, metadatas, recipientsData_1, recipientsData_1_1, recipient, ixs, recipientPublicKey, metadata, _e, escrowTokens, senderTokens, recipientTokens, streamflowTreasuryTokens, partnerPublicKey, partnerTokens, hash, tx, e_1_1, signed_batch, sigs, i, buf, signature;
246
244
  var e_1, _f, _g;
247
245
  return __generator(this, function (_h) {
248
246
  switch (_h.label) {
@@ -252,6 +250,7 @@ var StreamClient = /** @class */ (function () {
252
250
  commitment = typeof this.commitment == "string"
253
251
  ? this.commitment
254
252
  : this.commitment.commitment;
253
+ metadatas = [];
255
254
  _h.label = 1;
256
255
  case 1:
257
256
  _h.trys.push([1, 11, 12, 13]);
@@ -263,6 +262,7 @@ var StreamClient = /** @class */ (function () {
263
262
  ixs = [];
264
263
  recipientPublicKey = new web3_js_1.PublicKey(recipient.recipient);
265
264
  metadata = web3_js_1.Keypair.generate();
265
+ metadatas.push(metadata);
266
266
  return [4 /*yield*/, anchor_1.web3.PublicKey.findProgramAddress([buffer_1.Buffer.from("strm"), metadata.publicKey.toBuffer()], this.programId)];
267
267
  case 3:
268
268
  _e = __read.apply(void 0, [_h.sent(), 1]), escrowTokens = _e[0];
@@ -285,9 +285,9 @@ var StreamClient = /** @class */ (function () {
285
285
  start: new bn_js_1.default(start),
286
286
  depositedAmount: recipient.depositedAmount,
287
287
  period: new bn_js_1.default(period),
288
- amountPerPeriod: amountPerPeriod,
288
+ amountPerPeriod: recipient.amountPerPeriod,
289
289
  cliff: new bn_js_1.default(cliff),
290
- cliffAmount: cliffAmount,
290
+ cliffAmount: recipient.cliffAmount,
291
291
  cancelableBySender: cancelableBySender,
292
292
  cancelableByRecipient: cancelableByRecipient,
293
293
  automaticWithdrawal: automaticWithdrawal,
@@ -371,7 +371,7 @@ var StreamClient = /** @class */ (function () {
371
371
  case 20:
372
372
  i++;
373
373
  return [3 /*break*/, 18];
374
- case 21: return [2 /*return*/, { txs: sigs }];
374
+ case 21: return [2 /*return*/, { txs: sigs, metadatas: metadatas }];
375
375
  }
376
376
  });
377
377
  });
package/dist/types.d.ts CHANGED
@@ -44,6 +44,8 @@ export interface MultiRecipient {
44
44
  recipient: string;
45
45
  depositedAmount: BN;
46
46
  name: string;
47
+ cliffAmount: BN;
48
+ amountPerPeriod: BN;
47
49
  }
48
50
  export interface CreateMultiData {
49
51
  recipientsData: MultiRecipient[];
@@ -51,8 +53,6 @@ export interface CreateMultiData {
51
53
  start: number;
52
54
  period: number;
53
55
  cliff: number;
54
- cliffAmount: BN;
55
- amountPerPeriod: BN;
56
56
  canTopup: boolean;
57
57
  cancelableBySender: boolean;
58
58
  cancelableByRecipient: boolean;
@@ -231,4 +231,5 @@ export interface CreateResponse extends TxResponse {
231
231
  }
232
232
  export interface CreateMultiResponse {
233
233
  txs: TransactionSignature[];
234
+ metadatas: Keypair[];
234
235
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/stream",
3
- "version": "3.0.0-test.4",
3
+ "version": "3.0.1",
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/",