@streamflow/stream 3.0.15 → 3.0.16

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.
@@ -56,6 +56,7 @@ interface CreateUncheckedStreamData {
56
56
  partner: PublicKey;
57
57
  }
58
58
  interface CreateUncheckedStreamAccounts {
59
+ payer?: PublicKey;
59
60
  sender: PublicKey;
60
61
  senderTokens: PublicKey;
61
62
  metadata: PublicKey;
@@ -176,6 +176,13 @@ var createUncheckedStreamInstruction = function (data, programId, accounts) {
176
176
  { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
177
177
  { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
178
178
  ];
179
+ if (accounts.payer) {
180
+ keys.unshift({
181
+ pubkey: accounts.payer,
182
+ isSigner: true,
183
+ isWritable: true,
184
+ });
185
+ }
179
186
  var bufferData = buffer_1.Buffer.alloc(Layout.createUncheckedStreamLayout.span);
180
187
  var encodedUIntArray = new TextEncoder().encode(data.name);
181
188
  var streamNameBuffer = buffer_1.Buffer.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
@@ -201,8 +208,11 @@ var createUncheckedStreamInstruction = function (data, programId, accounts) {
201
208
  };
202
209
  var encodeLength = Layout.createUncheckedStreamLayout.encode(decodedData, bufferData);
203
210
  bufferData = bufferData.slice(0, encodeLength);
211
+ var digest = accounts.payer
212
+ ? js_sha256_1.sha256.digest("global:create_unchecked_with_payer")
213
+ : js_sha256_1.sha256.digest("global:create_unchecked");
204
214
  bufferData = buffer_1.Buffer.concat([
205
- buffer_1.Buffer.from(js_sha256_1.sha256.digest("global:create_unchecked")).slice(0, 8),
215
+ buffer_1.Buffer.from(digest).slice(0, 8),
206
216
  bufferData,
207
217
  buffer_1.Buffer.alloc(10),
208
218
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/stream",
3
- "version": "3.0.15",
3
+ "version": "3.0.16",
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/",