@bounded-sh/server 0.0.53-next.1 → 0.0.55

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/index.js CHANGED
@@ -86,11 +86,10 @@ const ALLOWED_SERVER_TX_PROGRAMS = new Set([
86
86
  COMPUTE_BUDGET_PROGRAM,
87
87
  SYSTEM_PROGRAM_ID,
88
88
  ]);
89
+ // Canonical set_documents discriminator (single wire format: ra_indices Vec<u8>).
89
90
  const SET_DOCUMENTS_DISCRIMINATOR = '79,46,72,73,24,79,66,245';
90
- const SET_DOCUMENTS_V2_DISCRIMINATOR = '22,236,242,185,145,61,26,39';
91
91
  const ALLOWED_BOUNDED_SET_DISCRIMINATORS = new Set([
92
92
  SET_DOCUMENTS_DISCRIMINATOR,
93
- SET_DOCUMENTS_V2_DISCRIMINATOR,
94
93
  ]);
95
94
  /* ──────────────────────────────────────────────────────────
96
95
  * Helper – fetch getPriorityFeeEstimate
@@ -216,15 +215,10 @@ function skipBoundedFieldOperation(cursor) {
216
215
  skipBoundedFieldValue(cursor);
217
216
  cursor.skip(1, 'operation kind');
218
217
  }
219
- function skipBoundedTxData(cursor, isV2) {
218
+ function skipBoundedTxData(cursor) {
220
219
  cursor.readString('txData plugin function key');
221
220
  cursor.skipBytes('txData bytes');
222
- if (isV2) {
223
- cursor.skipBytes('txData raIndices');
224
- return;
225
- }
226
- const raIndexCount = cursor.readU32('txData raIndices length');
227
- cursor.skip(raIndexCount * 8, 'txData raIndices');
221
+ cursor.skipBytes('txData raIndices');
228
222
  }
229
223
  function parseBoundedSetDocumentsInstruction(data) {
230
224
  if (data.length < 8) {
@@ -234,7 +228,6 @@ function parseBoundedSetDocumentsInstruction(data) {
234
228
  if (!ALLOWED_BOUNDED_SET_DISCRIMINATORS.has(discriminator)) {
235
229
  throw new Error('Server signedTransaction contains unsupported Bounded instruction');
236
230
  }
237
- const isV2 = discriminator === SET_DOCUMENTS_V2_DISCRIMINATOR;
238
231
  const cursor = new BorshCursor(data, 8);
239
232
  const appId = cursor.readString('appId');
240
233
  const documentPaths = [];
@@ -253,7 +246,7 @@ function parseBoundedSetDocumentsInstruction(data) {
253
246
  }
254
247
  const txDataCount = cursor.readU32('txData length');
255
248
  for (let i = 0; i < txDataCount; i++) {
256
- skipBoundedTxData(cursor, isV2);
249
+ skipBoundedTxData(cursor);
257
250
  }
258
251
  const simulate = cursor.readU8('simulate');
259
252
  if (simulate !== 0 && simulate !== 1) {