@streamflow/stream 3.0.1-test.0 → 3.0.2

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.
@@ -240,7 +240,7 @@ var StreamClient = /** @class */ (function () {
240
240
  StreamClient.prototype.createMultiple = function (_a) {
241
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;
242
242
  return __awaiter(this, void 0, void 0, function () {
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;
243
+ var mintPublicKey, batch, commitment, metadatas, metadataToRecipient, recipientsData_1, recipientsData_1_1, recipient, ixs, recipientPublicKey, metadata, metadataPubKey, _e, escrowTokens, senderTokens, recipientTokens, streamflowTreasuryTokens, partnerPublicKey, partnerTokens, hash, tx, e_1_1, signed_batch, sigs, i, buf, signature;
244
244
  var e_1, _f, _g;
245
245
  return __generator(this, function (_h) {
246
246
  switch (_h.label) {
@@ -251,6 +251,7 @@ var StreamClient = /** @class */ (function () {
251
251
  ? this.commitment
252
252
  : this.commitment.commitment;
253
253
  metadatas = [];
254
+ metadataToRecipient = {};
254
255
  _h.label = 1;
255
256
  case 1:
256
257
  _h.trys.push([1, 11, 12, 13]);
@@ -263,6 +264,8 @@ var StreamClient = /** @class */ (function () {
263
264
  recipientPublicKey = new web3_js_1.PublicKey(recipient.recipient);
264
265
  metadata = web3_js_1.Keypair.generate();
265
266
  metadatas.push(metadata);
267
+ metadataPubKey = metadata.publicKey.toBase58();
268
+ metadataToRecipient[metadataPubKey] = recipient;
266
269
  return [4 /*yield*/, anchor_1.web3.PublicKey.findProgramAddress([buffer_1.Buffer.from("strm"), metadata.publicKey.toBuffer()], this.programId)];
267
270
  case 3:
268
271
  _e = __read.apply(void 0, [_h.sent(), 1]), escrowTokens = _e[0];
@@ -371,7 +374,7 @@ var StreamClient = /** @class */ (function () {
371
374
  case 20:
372
375
  i++;
373
376
  return [3 /*break*/, 18];
374
- case 21: return [2 /*return*/, { txs: sigs, metadatas: metadatas }];
377
+ case 21: return [2 /*return*/, { txs: sigs, metadatas: metadatas, metadataToRecipient: metadataToRecipient }];
375
378
  }
376
379
  });
377
380
  });
package/dist/types.d.ts CHANGED
@@ -229,7 +229,11 @@ export interface TxResponse {
229
229
  export interface CreateResponse extends TxResponse {
230
230
  metadata: Keypair;
231
231
  }
232
+ export interface MetadataRecipientHashMap {
233
+ [metadataPubKey: string]: MultiRecipient;
234
+ }
232
235
  export interface CreateMultiResponse {
233
236
  txs: TransactionSignature[];
234
237
  metadatas: Keypair[];
238
+ metadataToRecipient: MetadataRecipientHashMap;
235
239
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/stream",
3
- "version": "3.0.1-test.0",
3
+ "version": "3.0.2",
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/",