@bounded-sh/server 0.0.53 → 0.0.56
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 +6 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -54,8 +54,8 @@ async function getIdToken() {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const PRESIGNED_BLOCKHASH_ERROR = 'Server signedTransaction blockhash is stale or expired';
|
|
57
|
-
const BOUNDED_PROGRAM_MAINNET = '
|
|
58
|
-
const BOUNDED_PROGRAM_DEVNET = '
|
|
57
|
+
const BOUNDED_PROGRAM_MAINNET = 'openTv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F';
|
|
58
|
+
const BOUNDED_PROGRAM_DEVNET = 'openTv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F';
|
|
59
59
|
const COMPUTE_BUDGET_PROGRAM = 'ComputeBudget111111111111111111111111111111';
|
|
60
60
|
const SYSTEM_PROGRAM_ID = '11111111111111111111111111111111';
|
|
61
61
|
const SUPPORTED_SOLANA_NETWORKS = ['solana_devnet', 'solana_mainnet'];
|
|
@@ -66,11 +66,10 @@ const ALLOWED_SERVER_TX_PROGRAMS = new Set([
|
|
|
66
66
|
COMPUTE_BUDGET_PROGRAM,
|
|
67
67
|
SYSTEM_PROGRAM_ID,
|
|
68
68
|
]);
|
|
69
|
+
// Canonical set_documents discriminator (single wire format: ra_indices Vec<u8>).
|
|
69
70
|
const SET_DOCUMENTS_DISCRIMINATOR = '79,46,72,73,24,79,66,245';
|
|
70
|
-
const SET_DOCUMENTS_V2_DISCRIMINATOR = '22,236,242,185,145,61,26,39';
|
|
71
71
|
const ALLOWED_BOUNDED_SET_DISCRIMINATORS = new Set([
|
|
72
72
|
SET_DOCUMENTS_DISCRIMINATOR,
|
|
73
|
-
SET_DOCUMENTS_V2_DISCRIMINATOR,
|
|
74
73
|
]);
|
|
75
74
|
/* ──────────────────────────────────────────────────────────
|
|
76
75
|
* Helper – fetch getPriorityFeeEstimate
|
|
@@ -196,15 +195,10 @@ function skipBoundedFieldOperation(cursor) {
|
|
|
196
195
|
skipBoundedFieldValue(cursor);
|
|
197
196
|
cursor.skip(1, 'operation kind');
|
|
198
197
|
}
|
|
199
|
-
function skipBoundedTxData(cursor
|
|
198
|
+
function skipBoundedTxData(cursor) {
|
|
200
199
|
cursor.readString('txData plugin function key');
|
|
201
200
|
cursor.skipBytes('txData bytes');
|
|
202
|
-
|
|
203
|
-
cursor.skipBytes('txData raIndices');
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const raIndexCount = cursor.readU32('txData raIndices length');
|
|
207
|
-
cursor.skip(raIndexCount * 8, 'txData raIndices');
|
|
201
|
+
cursor.skipBytes('txData raIndices');
|
|
208
202
|
}
|
|
209
203
|
function parseBoundedSetDocumentsInstruction(data) {
|
|
210
204
|
if (data.length < 8) {
|
|
@@ -214,7 +208,6 @@ function parseBoundedSetDocumentsInstruction(data) {
|
|
|
214
208
|
if (!ALLOWED_BOUNDED_SET_DISCRIMINATORS.has(discriminator)) {
|
|
215
209
|
throw new Error('Server signedTransaction contains unsupported Bounded instruction');
|
|
216
210
|
}
|
|
217
|
-
const isV2 = discriminator === SET_DOCUMENTS_V2_DISCRIMINATOR;
|
|
218
211
|
const cursor = new BorshCursor(data, 8);
|
|
219
212
|
const appId = cursor.readString('appId');
|
|
220
213
|
const documentPaths = [];
|
|
@@ -233,7 +226,7 @@ function parseBoundedSetDocumentsInstruction(data) {
|
|
|
233
226
|
}
|
|
234
227
|
const txDataCount = cursor.readU32('txData length');
|
|
235
228
|
for (let i = 0; i < txDataCount; i++) {
|
|
236
|
-
skipBoundedTxData(cursor
|
|
229
|
+
skipBoundedTxData(cursor);
|
|
237
230
|
}
|
|
238
231
|
const simulate = cursor.readU8('simulate');
|
|
239
232
|
if (simulate !== 0 && simulate !== 1) {
|