@bounded-sh/core 0.0.68 → 0.0.69

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.
Files changed (30) hide show
  1. package/README.md +0 -1
  2. package/dist/client/config.d.ts +4 -8
  3. package/dist/client/operations.d.ts +0 -3
  4. package/dist/client/reconcile.d.ts +7 -16
  5. package/dist/{index-C9h-Bnjk.mjs → index-B3aNfGi6.mjs} +36 -629
  6. package/dist/index-B3aNfGi6.mjs.map +1 -0
  7. package/dist/{index-C9w7qQpj.js → index-DlJKTmRv.js} +35 -632
  8. package/dist/index-DlJKTmRv.js.map +1 -0
  9. package/dist/index.d.ts +0 -2
  10. package/dist/index.js +1 -5
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +1 -1
  13. package/dist/{realtime-store-CQiij3zc.js → realtime-store-CkgpUOrE.js} +2 -2
  14. package/dist/{realtime-store-CQiij3zc.js.map → realtime-store-CkgpUOrE.js.map} +1 -1
  15. package/dist/{realtime-store-B_Szs6F3.mjs → realtime-store-i8pxSuZE.mjs} +2 -2
  16. package/dist/{realtime-store-B_Szs6F3.mjs.map → realtime-store-i8pxSuZE.mjs.map} +1 -1
  17. package/dist/{solana-message-ngQQt80s.mjs → solana-message-AXfv2U1S.mjs} +2 -2
  18. package/dist/{solana-message-ngQQt80s.mjs.map → solana-message-AXfv2U1S.mjs.map} +1 -1
  19. package/dist/{solana-message-DibkzgkZ.js → solana-message-DnV4FQ__.js} +2 -2
  20. package/dist/{solana-message-DibkzgkZ.js.map → solana-message-DnV4FQ__.js.map} +1 -1
  21. package/dist/{solana-operations-B0Q9UOHR.mjs → solana-operations-Bte92rmq.mjs} +2 -2
  22. package/dist/{solana-operations-B0Q9UOHR.mjs.map → solana-operations-Bte92rmq.mjs.map} +1 -1
  23. package/dist/{solana-operations-XjBhPOnu.js → solana-operations-DPul1dWo.js} +2 -2
  24. package/dist/{solana-operations-XjBhPOnu.js.map → solana-operations-DPul1dWo.js.map} +1 -1
  25. package/dist/types.d.ts +14 -182
  26. package/dist/utils/session-events.d.ts +2 -2
  27. package/package.json +2 -2
  28. package/dist/index-C9h-Bnjk.mjs.map +0 -1
  29. package/dist/index-C9w7qQpj.js.map +0 -1
  30. package/dist/utils/evm/evm-transaction-validation.d.ts +0 -46
@@ -1 +1 @@
1
- {"version":3,"file":"solana-operations-B0Q9UOHR.mjs","sources":["../.rollup-tmp/client/solana-operations.js"],"sourcesContent":["import { Buffer } from 'buffer';\nimport { getConfig } from './config';\nconst BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\n/**\n * Minimal base58 encoder, used ONLY to derive a Solana transaction signature\n * from already-signed bytes. Core deliberately does not take a `bs58`\n * dependency for eighteen lines of arithmetic.\n */\nfunction encodeBase58(bytes) {\n if (bytes.length === 0)\n return '';\n const digits = [0];\n for (const byte of bytes) {\n let carry = byte;\n for (let i = 0; i < digits.length; i++) {\n carry += digits[i] << 8;\n digits[i] = carry % 58;\n carry = (carry / 58) | 0;\n }\n while (carry > 0) {\n digits.push(carry % 58);\n carry = (carry / 58) | 0;\n }\n }\n let out = '';\n for (let i = 0; i < bytes.length && bytes[i] === 0; i++)\n out += BASE58_ALPHABET[0];\n for (let i = digits.length - 1; i >= 0; i--)\n out += BASE58_ALPHABET[digits[i]];\n return out;\n}\n/**\n * Derive the transaction signature from the SIGNED bytes, before broadcasting.\n *\n * Without this the signature is only learned when `sendRawTransaction` resolves,\n * so an RPC that accepted the bytes but whose response was lost throws with\n * nothing recorded — and a retry builds a DIFFERENT transaction that can land\n * beside the first.\n */\nexport function deriveTransactionSignature(signedTransaction) {\n var _a;\n const signature = (_a = signedTransaction.signatures) === null || _a === void 0 ? void 0 : _a[0];\n if (!signature || signature.length === 0) {\n throw new Error('Signed Solana transaction carries no signature to broadcast');\n }\n if (signature.every(byte => byte === 0)) {\n throw new Error('Signed Solana transaction carries an empty fee-payer signature');\n }\n return encodeBase58(Uint8Array.from(signature));\n}\n/**\n * Whether a send failure PROVES the transaction was never accepted. A preflight\n * rejection, a signature-verification failure, or an oversized/invalid\n * transaction is definitive and keeps throwing. A transport failure (timeout,\n * socket reset, aborted fetch) is ambiguous — the node may hold the bytes — and\n * must resolve as `submitted` carrying the pre-derived signature.\n *\n * \"already processed\" is deliberately NOT definitive: it means the signature\n * landed, which is the opposite of a failure.\n */\nconst DEFINITIVE_SEND_FAILURE_MARKERS = [\n 'simulation failed',\n 'preflight',\n 'blockhash not found',\n 'signature verification failure',\n 'transaction too large',\n 'invalid transaction',\n 'insufficient funds for rent',\n 'attempt to debit an account but found no record of a prior credit',\n];\nexport function isDefinitiveSolanaSendFailure(error) {\n var _a, _b, _c;\n const err = error;\n if (err && Array.isArray(err.logs))\n return true;\n if (err && String((_a = err.name) !== null && _a !== void 0 ? _a : '') === 'SendTransactionError')\n return true;\n const message = String((_c = (_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err) !== null && _c !== void 0 ? _c : '').toLowerCase();\n if (!message)\n return false;\n if (message.includes('already been processed') || message.includes('already processed'))\n return false;\n return DEFINITIVE_SEND_FAILURE_MARKERS.some(marker => message.includes(marker));\n}\nfunction errorText(error) {\n const message = error === null || error === void 0 ? void 0 : error.message;\n return typeof message === 'string' && message.length > 0 ? message : String(error);\n}\nconst BOUNDED_PROGRAM_MAINNET = ['open', 'Tv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F'].join('');\nconst BOUNDED_PROGRAM_DEVNET = ['open', 'Tv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F'].join('');\nconst COMPUTE_BUDGET_PROGRAM = 'ComputeBudget111111111111111111111111111111';\nconst SYSTEM_PROGRAM_ID = '11111111111111111111111111111111';\nconst ALLOWED_SERVER_TX_PROGRAMS = new Set([\n BOUNDED_PROGRAM_MAINNET,\n BOUNDED_PROGRAM_DEVNET,\n COMPUTE_BUDGET_PROGRAM,\n SYSTEM_PROGRAM_ID,\n]);\n// Canonical set_documents discriminator (single wire format: ra_indices Vec<u8>).\nconst SET_DOCUMENTS_DISCRIMINATOR = '79,46,72,73,24,79,66,245';\nconst ALLOWED_BOUNDED_SET_DISCRIMINATORS = new Set([\n SET_DOCUMENTS_DISCRIMINATOR,\n]);\nclass BorshCursor {\n constructor(data, offset, label) {\n this.data = data;\n this.offset = offset;\n this.label = label;\n }\n requireBytes(length, field) {\n if (this.offset + length > this.data.length) {\n throw new Error(`${this.label} has malformed Bounded instruction data while reading ${field}`);\n }\n }\n readU8(field) { this.requireBytes(1, field); return this.data[this.offset++]; }\n readU32(field) {\n this.requireBytes(4, field);\n const value = this.data[this.offset] | (this.data[this.offset + 1] << 8) |\n (this.data[this.offset + 2] << 16) | (this.data[this.offset + 3] << 24);\n this.offset += 4;\n return value >>> 0;\n }\n skip(length, field) { this.requireBytes(length, field); this.offset += length; }\n readString(field) {\n const length = this.readU32(`${field} length`);\n this.requireBytes(length, field);\n const raw = this.data.slice(this.offset, this.offset + length);\n this.offset += length;\n return Buffer.from(raw).toString('utf8');\n }\n skipBytes(field) { this.skip(this.readU32(`${field} length`), field); }\n isAtEnd() { return this.offset === this.data.length; }\n}\nfunction skipBoundedFieldValue(cursor) {\n const option = cursor.readU8('operation value option');\n if (option === 0)\n return;\n if (option !== 1)\n throw new Error('Server transaction has malformed Bounded field value option');\n const variant = cursor.readU8('operation value variant');\n if (variant === 0 || variant === 1)\n cursor.skip(8, 'operation numeric value');\n else if (variant === 2)\n cursor.skip(1, 'operation bool value');\n else if (variant === 3)\n cursor.readString('operation string value');\n else if (variant === 4)\n cursor.skip(32, 'operation address value');\n else\n throw new Error(`Server transaction has unsupported Bounded field value variant: ${variant}`);\n}\nfunction normalizeOnchainPath(path) {\n let normalized = path.startsWith('/') ? path.slice(1) : path;\n if (normalized.endsWith('*') && normalized.length > 1)\n normalized = normalized.slice(0, -1);\n if (normalized.endsWith('/'))\n normalized = normalized.slice(0, -1);\n return normalized;\n}\nfunction parseBoundedSetDocumentsInstruction(data, label) {\n if (data.length < 8)\n throw new Error(`${label} has malformed Bounded instruction data`);\n const discriminator = Array.from(data.slice(0, 8)).join(',');\n if (!ALLOWED_BOUNDED_SET_DISCRIMINATORS.has(discriminator)) {\n throw new Error(`${label} contains unsupported Bounded instruction`);\n }\n const cursor = new BorshCursor(data, 8, label);\n const appId = cursor.readString('appId');\n const documentPaths = [];\n const documentCount = cursor.readU32('documents length');\n for (let i = 0; i < documentCount; i++) {\n documentPaths.push(normalizeOnchainPath(cursor.readString('document path')));\n const operationCount = cursor.readU32('operations length');\n for (let j = 0; j < operationCount; j++) {\n cursor.readString('operation key');\n skipBoundedFieldValue(cursor);\n cursor.skip(1, 'operation kind');\n }\n }\n const deletePaths = [];\n const deleteCount = cursor.readU32('delete paths length');\n for (let i = 0; i < deleteCount; i++)\n deletePaths.push(normalizeOnchainPath(cursor.readString('delete path')));\n const txDataCount = cursor.readU32('txData length');\n for (let i = 0; i < txDataCount; i++) {\n cursor.readString('txData plugin function key');\n cursor.skipBytes('txData bytes');\n cursor.skipBytes('txData raIndices');\n }\n const simulate = cursor.readU8('simulate');\n if (simulate !== 0 && simulate !== 1)\n throw new Error(`${label} has malformed Bounded simulate flag`);\n if (!cursor.isAtEnd())\n throw new Error(`${label} has trailing Bounded instruction data`);\n return { appId, documentPaths, deletePaths };\n}\nfunction assertSamePathSet(label, expectedPaths, actualPaths) {\n const expected = new Set(expectedPaths.map(normalizeOnchainPath).filter(Boolean));\n const actual = new Set(actualPaths.map(normalizeOnchainPath).filter(Boolean));\n const missing = [...expected].filter(path => !actual.has(path));\n const extra = [...actual].filter(path => !expected.has(path));\n if (missing.length || extra.length) {\n const details = [missing.length ? `missing paths: ${missing.join(', ')}` : '', extra.length ? `unexpected paths: ${extra.join(', ')}` : '']\n .filter(Boolean).join('; ');\n throw new Error(`${label} Bounded instruction paths do not match requested write paths (${details})`);\n }\n}\nfunction deserializeAndValidateServerTransaction(serializedTransaction, VersionedTransactionClass, options) {\n var _a;\n const transaction = VersionedTransactionClass.deserialize(Buffer.from(serializedTransaction, 'base64'));\n const { label, expectedAppId, expectedWritePaths } = options;\n const accountKeys = transaction.message.staticAccountKeys;\n let boundedInstructionCount = 0;\n const actualWritePaths = [];\n for (const ix of transaction.message.compiledInstructions) {\n if (ix.programIdIndex >= accountKeys.length)\n throw new Error(`${label} has program ID in lookup table (not allowed)`);\n const programId = accountKeys[ix.programIdIndex].toBase58();\n if (!ALLOWED_SERVER_TX_PROGRAMS.has(programId))\n throw new Error(`${label} contains unauthorized program: ${programId}`);\n const data = ix.data instanceof Uint8Array ? ix.data : Buffer.from((_a = ix.data) !== null && _a !== void 0 ? _a : []);\n if (programId === SYSTEM_PROGRAM_ID)\n throw new Error(`${label} contains unauthorized System Program instruction`);\n if (programId === BOUNDED_PROGRAM_MAINNET || programId === BOUNDED_PROGRAM_DEVNET) {\n boundedInstructionCount++;\n const parsed = parseBoundedSetDocumentsInstruction(data, label);\n if (parsed.appId !== expectedAppId)\n throw new Error(`${label} Bounded instruction appId does not match configured appId`);\n actualWritePaths.push(...parsed.documentPaths, ...parsed.deletePaths);\n }\n }\n if (boundedInstructionCount !== 1)\n throw new Error(`${label} must contain exactly one Bounded set-documents instruction`);\n assertSamePathSet(label, expectedWritePaths, actualWritePaths);\n return transaction;\n}\nexport async function handlePreBuiltTransaction(tx, authProvider, options, expectedWritePaths) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const { Connection, VersionedTransaction } = await import(\"@solana/web3.js\");\n // Honor a wallet client's immutable config snapshot for the expected app-id\n // binding and RPC endpoint (CTA-05); otherwise read the global init() config.\n const config = (_b = (_a = options === null || options === void 0 ? void 0 : options._overrides) === null || _a === void 0 ? void 0 : _a._config) !== null && _b !== void 0 ? _b : await getConfig();\n const transaction = deserializeAndValidateServerTransaction(tx.serializedTransaction, VersionedTransaction, {\n label: 'Pre-built transaction', expectedAppId: config.appId, expectedWritePaths,\n });\n const shouldSubmit = (options === null || options === void 0 ? void 0 : options.shouldSubmitTx) !== false;\n const rpcUrl = (_c = config.rpcUrl) === null || _c === void 0 ? void 0 : _c.trim();\n const injectedRpc = (_d = options === null || options === void 0 ? void 0 : options._overrides) === null || _d === void 0 ? void 0 : _d._solanaRpc;\n if (shouldSubmit && !rpcUrl && !injectedRpc) {\n throw new Error(`Pre-built Solana transaction submission requires init({ rpcUrl }) for ${tx.network}`);\n }\n const signedTx = await authProvider.signTransaction(transaction);\n const rawTx = signedTx.serialize();\n const signedTransaction = Buffer.from(rawTx).toString('base64');\n // Keep the worker's expiry fence instead of discarding it: it is what makes\n // bounded same-signature reconciliation (and therefore the retry-safe\n // `expired_not_landed` exit) possible at all.\n const fence = { blockhash: tx.blockhash, lastValidBlockHeight: tx.lastValidBlockHeight };\n if (!shouldSubmit) {\n // Signed and NOT sent. There is no signature and nothing to mirror.\n return { outcome: 'signed', lane: 'solana', transactionSignature: null, signedTransaction, fence };\n }\n // Derive the signature from the signed bytes BEFORE broadcasting, so a send\n // whose response is lost still yields a reconcilable identifier.\n const signature = deriveTransactionSignature(signedTx);\n const connection = injectedRpc !== null && injectedRpc !== void 0 ? injectedRpc : new Connection(rpcUrl, 'confirmed');\n try {\n await connection.sendRawTransaction(rawTx, { skipPreflight: false, maxRetries: 3 });\n }\n catch (error) {\n // A definitive rejection never entered the network — keep throwing.\n if (isDefinitiveSolanaSendFailure(error))\n throw error;\n // Ambiguous transport outcome: the node may hold these exact bytes. Report\n // the pre-derived signature so the caller reconciles it instead of building\n // a second transaction that could land beside the first.\n return {\n outcome: 'submitted',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n reason: `Broadcast response was lost or inconclusive: ${errorText(error)}`,\n };\n }\n let confirmation;\n try {\n confirmation = await connection.confirmTransaction({\n signature, blockhash: tx.blockhash, lastValidBlockHeight: tx.lastValidBlockHeight,\n }, 'confirmed');\n }\n catch (error) {\n // The bytes were accepted; only the confirmation outcome is unknown.\n return {\n outcome: 'submitted',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n reason: `Confirmation outcome unknown: ${errorText(error)}`,\n };\n }\n // #310: \"confirmed\" only means the network recorded the transaction, not that it\n // succeeded - a landed-but-failed transaction carries an err. Report it as a failure\n // (with on-chain logs) instead of a fake success, mirroring the server keypair provider.\n if ((_e = confirmation.value) === null || _e === void 0 ? void 0 : _e.err) {\n let logMessages;\n try {\n const txInfo = await connection.getTransaction(signature, {\n maxSupportedTransactionVersion: 0,\n commitment: 'confirmed',\n });\n logMessages = (_f = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _f === void 0 ? void 0 : _f.logMessages;\n }\n catch (_j) {\n // Log retrieval is diagnostic only; the on-chain error is the verdict.\n }\n const errorMessage = logMessages ? JSON.stringify(logMessages) : JSON.stringify(confirmation.value.err);\n throw new Error(`Transaction failed: ${errorMessage}`);\n }\n return {\n outcome: 'confirmed',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n confirmationContextSlot: (_h = (_g = confirmation.context) === null || _g === void 0 ? void 0 : _g.slot) !== null && _h !== void 0 ? _h : 0,\n };\n}\n"],"names":["Buffer"],"mappings":";;;;;AAEA,MAAM,eAAe,GAAG,4DAA4D;AACpF;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;AAC1B,QAAQ,OAAO,EAAE;AACjB,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC;AACtB,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AAC9B,QAAQ,IAAI,KAAK,GAAG,IAAI;AACxB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAChD,YAAY,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,YAAY,MAAM,CAAC,CAAC,CAAC,GAAG,KAA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AAM,IAAI,KAAK,CAAC,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC,CAAC;AAC9D,IAAI;AACJ,IAAI,OAAO;AACX,QAAQ,OAAO,EAAE,WAAW;AAC5B,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,oBAAoB,EAAE,SAAS;AACvC,QAAQ,iBAAiB;AACzB,QAAQ,KAAK;AACb,QAAQ,uBAAuB,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,YAAY,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,CAAC;AACnJ,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"solana-operations-Bte92rmq.mjs","sources":["../.rollup-tmp/client/solana-operations.js"],"sourcesContent":["import { Buffer } from 'buffer';\nimport { getConfig } from './config';\nconst BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\n/**\n * Minimal base58 encoder, used ONLY to derive a Solana transaction signature\n * from already-signed bytes. Core deliberately does not take a `bs58`\n * dependency for eighteen lines of arithmetic.\n */\nfunction encodeBase58(bytes) {\n if (bytes.length === 0)\n return '';\n const digits = [0];\n for (const byte of bytes) {\n let carry = byte;\n for (let i = 0; i < digits.length; i++) {\n carry += digits[i] << 8;\n digits[i] = carry % 58;\n carry = (carry / 58) | 0;\n }\n while (carry > 0) {\n digits.push(carry % 58);\n carry = (carry / 58) | 0;\n }\n }\n let out = '';\n for (let i = 0; i < bytes.length && bytes[i] === 0; i++)\n out += BASE58_ALPHABET[0];\n for (let i = digits.length - 1; i >= 0; i--)\n out += BASE58_ALPHABET[digits[i]];\n return out;\n}\n/**\n * Derive the transaction signature from the SIGNED bytes, before broadcasting.\n *\n * Without this the signature is only learned when `sendRawTransaction` resolves,\n * so an RPC that accepted the bytes but whose response was lost throws with\n * nothing recorded — and a retry builds a DIFFERENT transaction that can land\n * beside the first.\n */\nexport function deriveTransactionSignature(signedTransaction) {\n var _a;\n const signature = (_a = signedTransaction.signatures) === null || _a === void 0 ? void 0 : _a[0];\n if (!signature || signature.length === 0) {\n throw new Error('Signed Solana transaction carries no signature to broadcast');\n }\n if (signature.every(byte => byte === 0)) {\n throw new Error('Signed Solana transaction carries an empty fee-payer signature');\n }\n return encodeBase58(Uint8Array.from(signature));\n}\n/**\n * Whether a send failure PROVES the transaction was never accepted. A preflight\n * rejection, a signature-verification failure, or an oversized/invalid\n * transaction is definitive and keeps throwing. A transport failure (timeout,\n * socket reset, aborted fetch) is ambiguous — the node may hold the bytes — and\n * must resolve as `submitted` carrying the pre-derived signature.\n *\n * \"already processed\" is deliberately NOT definitive: it means the signature\n * landed, which is the opposite of a failure.\n */\nconst DEFINITIVE_SEND_FAILURE_MARKERS = [\n 'simulation failed',\n 'preflight',\n 'blockhash not found',\n 'signature verification failure',\n 'transaction too large',\n 'invalid transaction',\n 'insufficient funds for rent',\n 'attempt to debit an account but found no record of a prior credit',\n];\nexport function isDefinitiveSolanaSendFailure(error) {\n var _a, _b, _c;\n const err = error;\n if (err && Array.isArray(err.logs))\n return true;\n if (err && String((_a = err.name) !== null && _a !== void 0 ? _a : '') === 'SendTransactionError')\n return true;\n const message = String((_c = (_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err) !== null && _c !== void 0 ? _c : '').toLowerCase();\n if (!message)\n return false;\n if (message.includes('already been processed') || message.includes('already processed'))\n return false;\n return DEFINITIVE_SEND_FAILURE_MARKERS.some(marker => message.includes(marker));\n}\nfunction errorText(error) {\n const message = error === null || error === void 0 ? void 0 : error.message;\n return typeof message === 'string' && message.length > 0 ? message : String(error);\n}\nconst BOUNDED_PROGRAM_MAINNET = ['open', 'Tv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F'].join('');\nconst BOUNDED_PROGRAM_DEVNET = ['open', 'Tv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F'].join('');\nconst COMPUTE_BUDGET_PROGRAM = 'ComputeBudget111111111111111111111111111111';\nconst SYSTEM_PROGRAM_ID = '11111111111111111111111111111111';\nconst ALLOWED_SERVER_TX_PROGRAMS = new Set([\n BOUNDED_PROGRAM_MAINNET,\n BOUNDED_PROGRAM_DEVNET,\n COMPUTE_BUDGET_PROGRAM,\n SYSTEM_PROGRAM_ID,\n]);\n// Canonical set_documents discriminator (single wire format: ra_indices Vec<u8>).\nconst SET_DOCUMENTS_DISCRIMINATOR = '79,46,72,73,24,79,66,245';\nconst ALLOWED_BOUNDED_SET_DISCRIMINATORS = new Set([\n SET_DOCUMENTS_DISCRIMINATOR,\n]);\nclass BorshCursor {\n constructor(data, offset, label) {\n this.data = data;\n this.offset = offset;\n this.label = label;\n }\n requireBytes(length, field) {\n if (this.offset + length > this.data.length) {\n throw new Error(`${this.label} has malformed Bounded instruction data while reading ${field}`);\n }\n }\n readU8(field) { this.requireBytes(1, field); return this.data[this.offset++]; }\n readU32(field) {\n this.requireBytes(4, field);\n const value = this.data[this.offset] | (this.data[this.offset + 1] << 8) |\n (this.data[this.offset + 2] << 16) | (this.data[this.offset + 3] << 24);\n this.offset += 4;\n return value >>> 0;\n }\n skip(length, field) { this.requireBytes(length, field); this.offset += length; }\n readString(field) {\n const length = this.readU32(`${field} length`);\n this.requireBytes(length, field);\n const raw = this.data.slice(this.offset, this.offset + length);\n this.offset += length;\n return Buffer.from(raw).toString('utf8');\n }\n skipBytes(field) { this.skip(this.readU32(`${field} length`), field); }\n isAtEnd() { return this.offset === this.data.length; }\n}\nfunction skipBoundedFieldValue(cursor) {\n const option = cursor.readU8('operation value option');\n if (option === 0)\n return;\n if (option !== 1)\n throw new Error('Server transaction has malformed Bounded field value option');\n const variant = cursor.readU8('operation value variant');\n if (variant === 0 || variant === 1)\n cursor.skip(8, 'operation numeric value');\n else if (variant === 2)\n cursor.skip(1, 'operation bool value');\n else if (variant === 3)\n cursor.readString('operation string value');\n else if (variant === 4)\n cursor.skip(32, 'operation address value');\n else\n throw new Error(`Server transaction has unsupported Bounded field value variant: ${variant}`);\n}\nfunction normalizeOnchainPath(path) {\n let normalized = path.startsWith('/') ? path.slice(1) : path;\n if (normalized.endsWith('*') && normalized.length > 1)\n normalized = normalized.slice(0, -1);\n if (normalized.endsWith('/'))\n normalized = normalized.slice(0, -1);\n return normalized;\n}\nfunction parseBoundedSetDocumentsInstruction(data, label) {\n if (data.length < 8)\n throw new Error(`${label} has malformed Bounded instruction data`);\n const discriminator = Array.from(data.slice(0, 8)).join(',');\n if (!ALLOWED_BOUNDED_SET_DISCRIMINATORS.has(discriminator)) {\n throw new Error(`${label} contains unsupported Bounded instruction`);\n }\n const cursor = new BorshCursor(data, 8, label);\n const appId = cursor.readString('appId');\n const documentPaths = [];\n const documentCount = cursor.readU32('documents length');\n for (let i = 0; i < documentCount; i++) {\n documentPaths.push(normalizeOnchainPath(cursor.readString('document path')));\n const operationCount = cursor.readU32('operations length');\n for (let j = 0; j < operationCount; j++) {\n cursor.readString('operation key');\n skipBoundedFieldValue(cursor);\n cursor.skip(1, 'operation kind');\n }\n }\n const deletePaths = [];\n const deleteCount = cursor.readU32('delete paths length');\n for (let i = 0; i < deleteCount; i++)\n deletePaths.push(normalizeOnchainPath(cursor.readString('delete path')));\n const txDataCount = cursor.readU32('txData length');\n for (let i = 0; i < txDataCount; i++) {\n cursor.readString('txData plugin function key');\n cursor.skipBytes('txData bytes');\n cursor.skipBytes('txData raIndices');\n }\n const simulate = cursor.readU8('simulate');\n if (simulate !== 0 && simulate !== 1)\n throw new Error(`${label} has malformed Bounded simulate flag`);\n if (!cursor.isAtEnd())\n throw new Error(`${label} has trailing Bounded instruction data`);\n return { appId, documentPaths, deletePaths };\n}\nfunction assertSamePathSet(label, expectedPaths, actualPaths) {\n const expected = new Set(expectedPaths.map(normalizeOnchainPath).filter(Boolean));\n const actual = new Set(actualPaths.map(normalizeOnchainPath).filter(Boolean));\n const missing = [...expected].filter(path => !actual.has(path));\n const extra = [...actual].filter(path => !expected.has(path));\n if (missing.length || extra.length) {\n const details = [missing.length ? `missing paths: ${missing.join(', ')}` : '', extra.length ? `unexpected paths: ${extra.join(', ')}` : '']\n .filter(Boolean).join('; ');\n throw new Error(`${label} Bounded instruction paths do not match requested write paths (${details})`);\n }\n}\nfunction deserializeAndValidateServerTransaction(serializedTransaction, VersionedTransactionClass, options) {\n var _a;\n const transaction = VersionedTransactionClass.deserialize(Buffer.from(serializedTransaction, 'base64'));\n const { label, expectedAppId, expectedWritePaths } = options;\n const accountKeys = transaction.message.staticAccountKeys;\n let boundedInstructionCount = 0;\n const actualWritePaths = [];\n for (const ix of transaction.message.compiledInstructions) {\n if (ix.programIdIndex >= accountKeys.length)\n throw new Error(`${label} has program ID in lookup table (not allowed)`);\n const programId = accountKeys[ix.programIdIndex].toBase58();\n if (!ALLOWED_SERVER_TX_PROGRAMS.has(programId))\n throw new Error(`${label} contains unauthorized program: ${programId}`);\n const data = ix.data instanceof Uint8Array ? ix.data : Buffer.from((_a = ix.data) !== null && _a !== void 0 ? _a : []);\n if (programId === SYSTEM_PROGRAM_ID)\n throw new Error(`${label} contains unauthorized System Program instruction`);\n if (programId === BOUNDED_PROGRAM_MAINNET || programId === BOUNDED_PROGRAM_DEVNET) {\n boundedInstructionCount++;\n const parsed = parseBoundedSetDocumentsInstruction(data, label);\n if (parsed.appId !== expectedAppId)\n throw new Error(`${label} Bounded instruction appId does not match configured appId`);\n actualWritePaths.push(...parsed.documentPaths, ...parsed.deletePaths);\n }\n }\n if (boundedInstructionCount !== 1)\n throw new Error(`${label} must contain exactly one Bounded set-documents instruction`);\n assertSamePathSet(label, expectedWritePaths, actualWritePaths);\n return transaction;\n}\nexport async function handlePreBuiltTransaction(tx, authProvider, options, expectedWritePaths) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const { Connection, VersionedTransaction } = await import(\"@solana/web3.js\");\n // Honor a wallet client's immutable config snapshot for the expected app-id\n // binding and RPC endpoint (CTA-05); otherwise read the global init() config.\n const config = (_b = (_a = options === null || options === void 0 ? void 0 : options._overrides) === null || _a === void 0 ? void 0 : _a._config) !== null && _b !== void 0 ? _b : await getConfig();\n const transaction = deserializeAndValidateServerTransaction(tx.serializedTransaction, VersionedTransaction, {\n label: 'Pre-built transaction', expectedAppId: config.appId, expectedWritePaths,\n });\n const shouldSubmit = (options === null || options === void 0 ? void 0 : options.shouldSubmitTx) !== false;\n const rpcUrl = (_c = config.rpcUrl) === null || _c === void 0 ? void 0 : _c.trim();\n const injectedRpc = (_d = options === null || options === void 0 ? void 0 : options._overrides) === null || _d === void 0 ? void 0 : _d._solanaRpc;\n if (shouldSubmit && !rpcUrl && !injectedRpc) {\n throw new Error(`Pre-built Solana transaction submission requires init({ rpcUrl }) for ${tx.network}`);\n }\n const signedTx = await authProvider.signTransaction(transaction);\n const rawTx = signedTx.serialize();\n const signedTransaction = Buffer.from(rawTx).toString('base64');\n // Keep the worker's expiry fence instead of discarding it: it is what makes\n // bounded same-signature reconciliation (and therefore the retry-safe\n // `expired_not_landed` exit) possible at all.\n const fence = { blockhash: tx.blockhash, lastValidBlockHeight: tx.lastValidBlockHeight };\n if (!shouldSubmit) {\n // Signed and NOT sent. There is no signature and nothing to mirror.\n return { outcome: 'signed', lane: 'solana', transactionSignature: null, signedTransaction, fence };\n }\n // Derive the signature from the signed bytes BEFORE broadcasting, so a send\n // whose response is lost still yields a reconcilable identifier.\n const signature = deriveTransactionSignature(signedTx);\n const connection = injectedRpc !== null && injectedRpc !== void 0 ? injectedRpc : new Connection(rpcUrl, 'confirmed');\n try {\n await connection.sendRawTransaction(rawTx, { skipPreflight: false, maxRetries: 3 });\n }\n catch (error) {\n // A definitive rejection never entered the network — keep throwing.\n if (isDefinitiveSolanaSendFailure(error))\n throw error;\n // Ambiguous transport outcome: the node may hold these exact bytes. Report\n // the pre-derived signature so the caller reconciles it instead of building\n // a second transaction that could land beside the first.\n return {\n outcome: 'submitted',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n reason: `Broadcast response was lost or inconclusive: ${errorText(error)}`,\n };\n }\n let confirmation;\n try {\n confirmation = await connection.confirmTransaction({\n signature, blockhash: tx.blockhash, lastValidBlockHeight: tx.lastValidBlockHeight,\n }, 'confirmed');\n }\n catch (error) {\n // The bytes were accepted; only the confirmation outcome is unknown.\n return {\n outcome: 'submitted',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n reason: `Confirmation outcome unknown: ${errorText(error)}`,\n };\n }\n // #310: \"confirmed\" only means the network recorded the transaction, not that it\n // succeeded - a landed-but-failed transaction carries an err. Report it as a failure\n // (with on-chain logs) instead of a fake success, mirroring the server keypair provider.\n if ((_e = confirmation.value) === null || _e === void 0 ? void 0 : _e.err) {\n let logMessages;\n try {\n const txInfo = await connection.getTransaction(signature, {\n maxSupportedTransactionVersion: 0,\n commitment: 'confirmed',\n });\n logMessages = (_f = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _f === void 0 ? void 0 : _f.logMessages;\n }\n catch (_j) {\n // Log retrieval is diagnostic only; the on-chain error is the verdict.\n }\n const errorMessage = logMessages ? JSON.stringify(logMessages) : JSON.stringify(confirmation.value.err);\n throw new Error(`Transaction failed: ${errorMessage}`);\n }\n return {\n outcome: 'confirmed',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n confirmationContextSlot: (_h = (_g = confirmation.context) === null || _g === void 0 ? void 0 : _g.slot) !== null && _h !== void 0 ? _h : 0,\n };\n}\n"],"names":["Buffer"],"mappings":";;;;;AAEA,MAAM,eAAe,GAAG,4DAA4D;AACpF;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;AAC1B,QAAQ,OAAO,EAAE;AACjB,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC;AACtB,IAAI,KAAK,MAAM,IA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AAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW;AAChJ,QAAQ;AACR,QAAQ,OAAO,EAAE,EAAE;AACnB;AACA,QAAQ;AACR,QAAQ,MAAM,YAAY,GAAG,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC;AAC/G,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC,CAAC;AAC9D,IAAI;AACJ,IAAI,OAAO;AACX,QAAQ,OAAO,EAAE,WAAW;AAC5B,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,oBAAoB,EAAE,SAAS;AACvC,QAAQ,iBAAiB;AACzB,QAAQ,KAAK;AACb,QAAQ,uBAAuB,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,YAAY,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,CAAC;AACnJ,KAAK;AACL;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-C9w7qQpj.js');
3
+ var index = require('./index-DlJKTmRv.js');
4
4
  require('axios');
5
5
  require('tweetnacl');
6
6
  require('reconnecting-websocket');
@@ -336,4 +336,4 @@ async function handlePreBuiltTransaction(tx, authProvider, options, expectedWrit
336
336
  exports.deriveTransactionSignature = deriveTransactionSignature;
337
337
  exports.handlePreBuiltTransaction = handlePreBuiltTransaction;
338
338
  exports.isDefinitiveSolanaSendFailure = isDefinitiveSolanaSendFailure;
339
- //# sourceMappingURL=solana-operations-XjBhPOnu.js.map
339
+ //# sourceMappingURL=solana-operations-DPul1dWo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"solana-operations-XjBhPOnu.js","sources":["../.rollup-tmp/client/solana-operations.js"],"sourcesContent":["import { Buffer } from 'buffer';\nimport { getConfig } from './config';\nconst BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\n/**\n * Minimal base58 encoder, used ONLY to derive a Solana transaction signature\n * from already-signed bytes. Core deliberately does not take a `bs58`\n * dependency for eighteen lines of arithmetic.\n */\nfunction encodeBase58(bytes) {\n if (bytes.length === 0)\n return '';\n const digits = [0];\n for (const byte of bytes) {\n let carry = byte;\n for (let i = 0; i < digits.length; i++) {\n carry += digits[i] << 8;\n digits[i] = carry % 58;\n carry = (carry / 58) | 0;\n }\n while (carry > 0) {\n digits.push(carry % 58);\n carry = (carry / 58) | 0;\n }\n }\n let out = '';\n for (let i = 0; i < bytes.length && bytes[i] === 0; i++)\n out += BASE58_ALPHABET[0];\n for (let i = digits.length - 1; i >= 0; i--)\n out += BASE58_ALPHABET[digits[i]];\n return out;\n}\n/**\n * Derive the transaction signature from the SIGNED bytes, before broadcasting.\n *\n * Without this the signature is only learned when `sendRawTransaction` resolves,\n * so an RPC that accepted the bytes but whose response was lost throws with\n * nothing recorded — and a retry builds a DIFFERENT transaction that can land\n * beside the first.\n */\nexport function deriveTransactionSignature(signedTransaction) {\n var _a;\n const signature = (_a = signedTransaction.signatures) === null || _a === void 0 ? void 0 : _a[0];\n if (!signature || signature.length === 0) {\n throw new Error('Signed Solana transaction carries no signature to broadcast');\n }\n if (signature.every(byte => byte === 0)) {\n throw new Error('Signed Solana transaction carries an empty fee-payer signature');\n }\n return encodeBase58(Uint8Array.from(signature));\n}\n/**\n * Whether a send failure PROVES the transaction was never accepted. A preflight\n * rejection, a signature-verification failure, or an oversized/invalid\n * transaction is definitive and keeps throwing. A transport failure (timeout,\n * socket reset, aborted fetch) is ambiguous — the node may hold the bytes — and\n * must resolve as `submitted` carrying the pre-derived signature.\n *\n * \"already processed\" is deliberately NOT definitive: it means the signature\n * landed, which is the opposite of a failure.\n */\nconst DEFINITIVE_SEND_FAILURE_MARKERS = [\n 'simulation failed',\n 'preflight',\n 'blockhash not found',\n 'signature verification failure',\n 'transaction too large',\n 'invalid transaction',\n 'insufficient funds for rent',\n 'attempt to debit an account but found no record of a prior credit',\n];\nexport function isDefinitiveSolanaSendFailure(error) {\n var _a, _b, _c;\n const err = error;\n if (err && Array.isArray(err.logs))\n return true;\n if (err && String((_a = err.name) !== null && _a !== void 0 ? _a : '') === 'SendTransactionError')\n return true;\n const message = String((_c = (_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err) !== null && _c !== void 0 ? _c : '').toLowerCase();\n if (!message)\n return false;\n if (message.includes('already been processed') || message.includes('already processed'))\n return false;\n return DEFINITIVE_SEND_FAILURE_MARKERS.some(marker => message.includes(marker));\n}\nfunction errorText(error) {\n const message = error === null || error === void 0 ? void 0 : error.message;\n return typeof message === 'string' && message.length > 0 ? message : String(error);\n}\nconst BOUNDED_PROGRAM_MAINNET = ['open', 'Tv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F'].join('');\nconst BOUNDED_PROGRAM_DEVNET = ['open', 'Tv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F'].join('');\nconst COMPUTE_BUDGET_PROGRAM = 'ComputeBudget111111111111111111111111111111';\nconst SYSTEM_PROGRAM_ID = '11111111111111111111111111111111';\nconst ALLOWED_SERVER_TX_PROGRAMS = new Set([\n BOUNDED_PROGRAM_MAINNET,\n BOUNDED_PROGRAM_DEVNET,\n COMPUTE_BUDGET_PROGRAM,\n SYSTEM_PROGRAM_ID,\n]);\n// Canonical set_documents discriminator (single wire format: ra_indices Vec<u8>).\nconst SET_DOCUMENTS_DISCRIMINATOR = '79,46,72,73,24,79,66,245';\nconst ALLOWED_BOUNDED_SET_DISCRIMINATORS = new Set([\n SET_DOCUMENTS_DISCRIMINATOR,\n]);\nclass BorshCursor {\n constructor(data, offset, label) {\n this.data = data;\n this.offset = offset;\n this.label = label;\n }\n requireBytes(length, field) {\n if (this.offset + length > this.data.length) {\n throw new Error(`${this.label} has malformed Bounded instruction data while reading ${field}`);\n }\n }\n readU8(field) { this.requireBytes(1, field); return this.data[this.offset++]; }\n readU32(field) {\n this.requireBytes(4, field);\n const value = this.data[this.offset] | (this.data[this.offset + 1] << 8) |\n (this.data[this.offset + 2] << 16) | (this.data[this.offset + 3] << 24);\n this.offset += 4;\n return value >>> 0;\n }\n skip(length, field) { this.requireBytes(length, field); this.offset += length; }\n readString(field) {\n const length = this.readU32(`${field} length`);\n this.requireBytes(length, field);\n const raw = this.data.slice(this.offset, this.offset + length);\n this.offset += length;\n return Buffer.from(raw).toString('utf8');\n }\n skipBytes(field) { this.skip(this.readU32(`${field} length`), field); }\n isAtEnd() { return this.offset === this.data.length; }\n}\nfunction skipBoundedFieldValue(cursor) {\n const option = cursor.readU8('operation value option');\n if (option === 0)\n return;\n if (option !== 1)\n throw new Error('Server transaction has malformed Bounded field value option');\n const variant = cursor.readU8('operation value variant');\n if (variant === 0 || variant === 1)\n cursor.skip(8, 'operation numeric value');\n else if (variant === 2)\n cursor.skip(1, 'operation bool value');\n else if (variant === 3)\n cursor.readString('operation string value');\n else if (variant === 4)\n cursor.skip(32, 'operation address value');\n else\n throw new Error(`Server transaction has unsupported Bounded field value variant: ${variant}`);\n}\nfunction normalizeOnchainPath(path) {\n let normalized = path.startsWith('/') ? path.slice(1) : path;\n if (normalized.endsWith('*') && normalized.length > 1)\n normalized = normalized.slice(0, -1);\n if (normalized.endsWith('/'))\n normalized = normalized.slice(0, -1);\n return normalized;\n}\nfunction parseBoundedSetDocumentsInstruction(data, label) {\n if (data.length < 8)\n throw new Error(`${label} has malformed Bounded instruction data`);\n const discriminator = Array.from(data.slice(0, 8)).join(',');\n if (!ALLOWED_BOUNDED_SET_DISCRIMINATORS.has(discriminator)) {\n throw new Error(`${label} contains unsupported Bounded instruction`);\n }\n const cursor = new BorshCursor(data, 8, label);\n const appId = cursor.readString('appId');\n const documentPaths = [];\n const documentCount = cursor.readU32('documents length');\n for (let i = 0; i < documentCount; i++) {\n documentPaths.push(normalizeOnchainPath(cursor.readString('document path')));\n const operationCount = cursor.readU32('operations length');\n for (let j = 0; j < operationCount; j++) {\n cursor.readString('operation key');\n skipBoundedFieldValue(cursor);\n cursor.skip(1, 'operation kind');\n }\n }\n const deletePaths = [];\n const deleteCount = cursor.readU32('delete paths length');\n for (let i = 0; i < deleteCount; i++)\n deletePaths.push(normalizeOnchainPath(cursor.readString('delete path')));\n const txDataCount = cursor.readU32('txData length');\n for (let i = 0; i < txDataCount; i++) {\n cursor.readString('txData plugin function key');\n cursor.skipBytes('txData bytes');\n cursor.skipBytes('txData raIndices');\n }\n const simulate = cursor.readU8('simulate');\n if (simulate !== 0 && simulate !== 1)\n throw new Error(`${label} has malformed Bounded simulate flag`);\n if (!cursor.isAtEnd())\n throw new Error(`${label} has trailing Bounded instruction data`);\n return { appId, documentPaths, deletePaths };\n}\nfunction assertSamePathSet(label, expectedPaths, actualPaths) {\n const expected = new Set(expectedPaths.map(normalizeOnchainPath).filter(Boolean));\n const actual = new Set(actualPaths.map(normalizeOnchainPath).filter(Boolean));\n const missing = [...expected].filter(path => !actual.has(path));\n const extra = [...actual].filter(path => !expected.has(path));\n if (missing.length || extra.length) {\n const details = [missing.length ? `missing paths: ${missing.join(', ')}` : '', extra.length ? `unexpected paths: ${extra.join(', ')}` : '']\n .filter(Boolean).join('; ');\n throw new Error(`${label} Bounded instruction paths do not match requested write paths (${details})`);\n }\n}\nfunction deserializeAndValidateServerTransaction(serializedTransaction, VersionedTransactionClass, options) {\n var _a;\n const transaction = VersionedTransactionClass.deserialize(Buffer.from(serializedTransaction, 'base64'));\n const { label, expectedAppId, expectedWritePaths } = options;\n const accountKeys = transaction.message.staticAccountKeys;\n let boundedInstructionCount = 0;\n const actualWritePaths = [];\n for (const ix of transaction.message.compiledInstructions) {\n if (ix.programIdIndex >= accountKeys.length)\n throw new Error(`${label} has program ID in lookup table (not allowed)`);\n const programId = accountKeys[ix.programIdIndex].toBase58();\n if (!ALLOWED_SERVER_TX_PROGRAMS.has(programId))\n throw new Error(`${label} contains unauthorized program: ${programId}`);\n const data = ix.data instanceof Uint8Array ? ix.data : Buffer.from((_a = ix.data) !== null && _a !== void 0 ? _a : []);\n if (programId === SYSTEM_PROGRAM_ID)\n throw new Error(`${label} contains unauthorized System Program instruction`);\n if (programId === BOUNDED_PROGRAM_MAINNET || programId === BOUNDED_PROGRAM_DEVNET) {\n boundedInstructionCount++;\n const parsed = parseBoundedSetDocumentsInstruction(data, label);\n if (parsed.appId !== expectedAppId)\n throw new Error(`${label} Bounded instruction appId does not match configured appId`);\n actualWritePaths.push(...parsed.documentPaths, ...parsed.deletePaths);\n }\n }\n if (boundedInstructionCount !== 1)\n throw new Error(`${label} must contain exactly one Bounded set-documents instruction`);\n assertSamePathSet(label, expectedWritePaths, actualWritePaths);\n return transaction;\n}\nexport async function handlePreBuiltTransaction(tx, authProvider, options, expectedWritePaths) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const { Connection, VersionedTransaction } = await import(\"@solana/web3.js\");\n // Honor a wallet client's immutable config snapshot for the expected app-id\n // binding and RPC endpoint (CTA-05); otherwise read the global init() config.\n const config = (_b = (_a = options === null || options === void 0 ? void 0 : options._overrides) === null || _a === void 0 ? void 0 : _a._config) !== null && _b !== void 0 ? _b : await getConfig();\n const transaction = deserializeAndValidateServerTransaction(tx.serializedTransaction, VersionedTransaction, {\n label: 'Pre-built transaction', expectedAppId: config.appId, expectedWritePaths,\n });\n const shouldSubmit = (options === null || options === void 0 ? void 0 : options.shouldSubmitTx) !== false;\n const rpcUrl = (_c = config.rpcUrl) === null || _c === void 0 ? void 0 : _c.trim();\n const injectedRpc = (_d = options === null || options === void 0 ? void 0 : options._overrides) === null || _d === void 0 ? void 0 : _d._solanaRpc;\n if (shouldSubmit && !rpcUrl && !injectedRpc) {\n throw new Error(`Pre-built Solana transaction submission requires init({ rpcUrl }) for ${tx.network}`);\n }\n const signedTx = await authProvider.signTransaction(transaction);\n const rawTx = signedTx.serialize();\n const signedTransaction = Buffer.from(rawTx).toString('base64');\n // Keep the worker's expiry fence instead of discarding it: it is what makes\n // bounded same-signature reconciliation (and therefore the retry-safe\n // `expired_not_landed` exit) possible at all.\n const fence = { blockhash: tx.blockhash, lastValidBlockHeight: tx.lastValidBlockHeight };\n if (!shouldSubmit) {\n // Signed and NOT sent. There is no signature and nothing to mirror.\n return { outcome: 'signed', lane: 'solana', transactionSignature: null, signedTransaction, fence };\n }\n // Derive the signature from the signed bytes BEFORE broadcasting, so a send\n // whose response is lost still yields a reconcilable identifier.\n const signature = deriveTransactionSignature(signedTx);\n const connection = injectedRpc !== null && injectedRpc !== void 0 ? injectedRpc : new Connection(rpcUrl, 'confirmed');\n try {\n await connection.sendRawTransaction(rawTx, { skipPreflight: false, maxRetries: 3 });\n }\n catch (error) {\n // A definitive rejection never entered the network — keep throwing.\n if (isDefinitiveSolanaSendFailure(error))\n throw error;\n // Ambiguous transport outcome: the node may hold these exact bytes. Report\n // the pre-derived signature so the caller reconciles it instead of building\n // a second transaction that could land beside the first.\n return {\n outcome: 'submitted',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n reason: `Broadcast response was lost or inconclusive: ${errorText(error)}`,\n };\n }\n let confirmation;\n try {\n confirmation = await connection.confirmTransaction({\n signature, blockhash: tx.blockhash, lastValidBlockHeight: tx.lastValidBlockHeight,\n }, 'confirmed');\n }\n catch (error) {\n // The bytes were accepted; only the confirmation outcome is unknown.\n return {\n outcome: 'submitted',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n reason: `Confirmation outcome unknown: ${errorText(error)}`,\n };\n }\n // #310: \"confirmed\" only means the network recorded the transaction, not that it\n // succeeded - a landed-but-failed transaction carries an err. Report it as a failure\n // (with on-chain logs) instead of a fake success, mirroring the server keypair provider.\n if ((_e = confirmation.value) === null || _e === void 0 ? void 0 : _e.err) {\n let logMessages;\n try {\n const txInfo = await connection.getTransaction(signature, {\n maxSupportedTransactionVersion: 0,\n commitment: 'confirmed',\n });\n logMessages = (_f = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _f === void 0 ? void 0 : _f.logMessages;\n }\n catch (_j) {\n // Log retrieval is diagnostic only; the on-chain error is the verdict.\n }\n const errorMessage = logMessages ? JSON.stringify(logMessages) : JSON.stringify(confirmation.value.err);\n throw new Error(`Transaction failed: ${errorMessage}`);\n }\n return {\n outcome: 'confirmed',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n confirmationContextSlot: (_h = (_g = confirmation.context) === null || _g === void 0 ? void 0 : _g.slot) !== null && _h !== void 0 ? _h : 0,\n };\n}\n"],"names":["Buffer","getConfig"],"mappings":";;;;;;;AAEA,MAAM,eAAe,GAAG,4DAA4D;AACpF;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;AAC1B,QAAQ,OAAO,EAAE;AACjB,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC;AACtB,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AAC9B,QAAQ,IAAI,KAAK,GAAG,IAAI;AACxB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAChD,YAAY,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,YAAY,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;AAClC,YAAY,KAAK,GAAG,CAAC,KAAK,GAAG,EAAE,IAAI,CAAC;AACpC,QAAQ;AACR,QAAQ,OAAO,KAAK,GAAG,CAAC,EAAE;AAC1B,YAAY,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;AACnC,YAAY,KAAK,GAAG,CAAC,KAAK,GAAG,EAAE,IAAI,CAAC;AACp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uB,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,YAAY,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,CAAC;AACnJ,KAAK;AACL;;;;;;"}
1
+ {"version":3,"file":"solana-operations-DPul1dWo.js","sources":["../.rollup-tmp/client/solana-operations.js"],"sourcesContent":["import { Buffer } from 'buffer';\nimport { getConfig } from './config';\nconst BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\n/**\n * Minimal base58 encoder, used ONLY to derive a Solana transaction signature\n * from already-signed bytes. Core deliberately does not take a `bs58`\n * dependency for eighteen lines of arithmetic.\n */\nfunction encodeBase58(bytes) {\n if (bytes.length === 0)\n return '';\n const digits = [0];\n for (const byte of bytes) {\n let carry = byte;\n for (let i = 0; i < digits.length; i++) {\n carry += digits[i] << 8;\n digits[i] = carry % 58;\n carry = (carry / 58) | 0;\n }\n while (carry > 0) {\n digits.push(carry % 58);\n carry = (carry / 58) | 0;\n }\n }\n let out = '';\n for (let i = 0; i < bytes.length && bytes[i] === 0; i++)\n out += BASE58_ALPHABET[0];\n for (let i = digits.length - 1; i >= 0; i--)\n out += BASE58_ALPHABET[digits[i]];\n return out;\n}\n/**\n * Derive the transaction signature from the SIGNED bytes, before broadcasting.\n *\n * Without this the signature is only learned when `sendRawTransaction` resolves,\n * so an RPC that accepted the bytes but whose response was lost throws with\n * nothing recorded — and a retry builds a DIFFERENT transaction that can land\n * beside the first.\n */\nexport function deriveTransactionSignature(signedTransaction) {\n var _a;\n const signature = (_a = signedTransaction.signatures) === null || _a === void 0 ? void 0 : _a[0];\n if (!signature || signature.length === 0) {\n throw new Error('Signed Solana transaction carries no signature to broadcast');\n }\n if (signature.every(byte => byte === 0)) {\n throw new Error('Signed Solana transaction carries an empty fee-payer signature');\n }\n return encodeBase58(Uint8Array.from(signature));\n}\n/**\n * Whether a send failure PROVES the transaction was never accepted. A preflight\n * rejection, a signature-verification failure, or an oversized/invalid\n * transaction is definitive and keeps throwing. A transport failure (timeout,\n * socket reset, aborted fetch) is ambiguous — the node may hold the bytes — and\n * must resolve as `submitted` carrying the pre-derived signature.\n *\n * \"already processed\" is deliberately NOT definitive: it means the signature\n * landed, which is the opposite of a failure.\n */\nconst DEFINITIVE_SEND_FAILURE_MARKERS = [\n 'simulation failed',\n 'preflight',\n 'blockhash not found',\n 'signature verification failure',\n 'transaction too large',\n 'invalid transaction',\n 'insufficient funds for rent',\n 'attempt to debit an account but found no record of a prior credit',\n];\nexport function isDefinitiveSolanaSendFailure(error) {\n var _a, _b, _c;\n const err = error;\n if (err && Array.isArray(err.logs))\n return true;\n if (err && String((_a = err.name) !== null && _a !== void 0 ? _a : '') === 'SendTransactionError')\n return true;\n const message = String((_c = (_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err) !== null && _c !== void 0 ? _c : '').toLowerCase();\n if (!message)\n return false;\n if (message.includes('already been processed') || message.includes('already processed'))\n return false;\n return DEFINITIVE_SEND_FAILURE_MARKERS.some(marker => message.includes(marker));\n}\nfunction errorText(error) {\n const message = error === null || error === void 0 ? void 0 : error.message;\n return typeof message === 'string' && message.length > 0 ? message : String(error);\n}\nconst BOUNDED_PROGRAM_MAINNET = ['open', 'Tv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F'].join('');\nconst BOUNDED_PROGRAM_DEVNET = ['open', 'Tv7fbpYSseNHYmCZFZ1CZgj4r8D9fKNgEz1qo6F'].join('');\nconst COMPUTE_BUDGET_PROGRAM = 'ComputeBudget111111111111111111111111111111';\nconst SYSTEM_PROGRAM_ID = '11111111111111111111111111111111';\nconst ALLOWED_SERVER_TX_PROGRAMS = new Set([\n BOUNDED_PROGRAM_MAINNET,\n BOUNDED_PROGRAM_DEVNET,\n COMPUTE_BUDGET_PROGRAM,\n SYSTEM_PROGRAM_ID,\n]);\n// Canonical set_documents discriminator (single wire format: ra_indices Vec<u8>).\nconst SET_DOCUMENTS_DISCRIMINATOR = '79,46,72,73,24,79,66,245';\nconst ALLOWED_BOUNDED_SET_DISCRIMINATORS = new Set([\n SET_DOCUMENTS_DISCRIMINATOR,\n]);\nclass BorshCursor {\n constructor(data, offset, label) {\n this.data = data;\n this.offset = offset;\n this.label = label;\n }\n requireBytes(length, field) {\n if (this.offset + length > this.data.length) {\n throw new Error(`${this.label} has malformed Bounded instruction data while reading ${field}`);\n }\n }\n readU8(field) { this.requireBytes(1, field); return this.data[this.offset++]; }\n readU32(field) {\n this.requireBytes(4, field);\n const value = this.data[this.offset] | (this.data[this.offset + 1] << 8) |\n (this.data[this.offset + 2] << 16) | (this.data[this.offset + 3] << 24);\n this.offset += 4;\n return value >>> 0;\n }\n skip(length, field) { this.requireBytes(length, field); this.offset += length; }\n readString(field) {\n const length = this.readU32(`${field} length`);\n this.requireBytes(length, field);\n const raw = this.data.slice(this.offset, this.offset + length);\n this.offset += length;\n return Buffer.from(raw).toString('utf8');\n }\n skipBytes(field) { this.skip(this.readU32(`${field} length`), field); }\n isAtEnd() { return this.offset === this.data.length; }\n}\nfunction skipBoundedFieldValue(cursor) {\n const option = cursor.readU8('operation value option');\n if (option === 0)\n return;\n if (option !== 1)\n throw new Error('Server transaction has malformed Bounded field value option');\n const variant = cursor.readU8('operation value variant');\n if (variant === 0 || variant === 1)\n cursor.skip(8, 'operation numeric value');\n else if (variant === 2)\n cursor.skip(1, 'operation bool value');\n else if (variant === 3)\n cursor.readString('operation string value');\n else if (variant === 4)\n cursor.skip(32, 'operation address value');\n else\n throw new Error(`Server transaction has unsupported Bounded field value variant: ${variant}`);\n}\nfunction normalizeOnchainPath(path) {\n let normalized = path.startsWith('/') ? path.slice(1) : path;\n if (normalized.endsWith('*') && normalized.length > 1)\n normalized = normalized.slice(0, -1);\n if (normalized.endsWith('/'))\n normalized = normalized.slice(0, -1);\n return normalized;\n}\nfunction parseBoundedSetDocumentsInstruction(data, label) {\n if (data.length < 8)\n throw new Error(`${label} has malformed Bounded instruction data`);\n const discriminator = Array.from(data.slice(0, 8)).join(',');\n if (!ALLOWED_BOUNDED_SET_DISCRIMINATORS.has(discriminator)) {\n throw new Error(`${label} contains unsupported Bounded instruction`);\n }\n const cursor = new BorshCursor(data, 8, label);\n const appId = cursor.readString('appId');\n const documentPaths = [];\n const documentCount = cursor.readU32('documents length');\n for (let i = 0; i < documentCount; i++) {\n documentPaths.push(normalizeOnchainPath(cursor.readString('document path')));\n const operationCount = cursor.readU32('operations length');\n for (let j = 0; j < operationCount; j++) {\n cursor.readString('operation key');\n skipBoundedFieldValue(cursor);\n cursor.skip(1, 'operation kind');\n }\n }\n const deletePaths = [];\n const deleteCount = cursor.readU32('delete paths length');\n for (let i = 0; i < deleteCount; i++)\n deletePaths.push(normalizeOnchainPath(cursor.readString('delete path')));\n const txDataCount = cursor.readU32('txData length');\n for (let i = 0; i < txDataCount; i++) {\n cursor.readString('txData plugin function key');\n cursor.skipBytes('txData bytes');\n cursor.skipBytes('txData raIndices');\n }\n const simulate = cursor.readU8('simulate');\n if (simulate !== 0 && simulate !== 1)\n throw new Error(`${label} has malformed Bounded simulate flag`);\n if (!cursor.isAtEnd())\n throw new Error(`${label} has trailing Bounded instruction data`);\n return { appId, documentPaths, deletePaths };\n}\nfunction assertSamePathSet(label, expectedPaths, actualPaths) {\n const expected = new Set(expectedPaths.map(normalizeOnchainPath).filter(Boolean));\n const actual = new Set(actualPaths.map(normalizeOnchainPath).filter(Boolean));\n const missing = [...expected].filter(path => !actual.has(path));\n const extra = [...actual].filter(path => !expected.has(path));\n if (missing.length || extra.length) {\n const details = [missing.length ? `missing paths: ${missing.join(', ')}` : '', extra.length ? `unexpected paths: ${extra.join(', ')}` : '']\n .filter(Boolean).join('; ');\n throw new Error(`${label} Bounded instruction paths do not match requested write paths (${details})`);\n }\n}\nfunction deserializeAndValidateServerTransaction(serializedTransaction, VersionedTransactionClass, options) {\n var _a;\n const transaction = VersionedTransactionClass.deserialize(Buffer.from(serializedTransaction, 'base64'));\n const { label, expectedAppId, expectedWritePaths } = options;\n const accountKeys = transaction.message.staticAccountKeys;\n let boundedInstructionCount = 0;\n const actualWritePaths = [];\n for (const ix of transaction.message.compiledInstructions) {\n if (ix.programIdIndex >= accountKeys.length)\n throw new Error(`${label} has program ID in lookup table (not allowed)`);\n const programId = accountKeys[ix.programIdIndex].toBase58();\n if (!ALLOWED_SERVER_TX_PROGRAMS.has(programId))\n throw new Error(`${label} contains unauthorized program: ${programId}`);\n const data = ix.data instanceof Uint8Array ? ix.data : Buffer.from((_a = ix.data) !== null && _a !== void 0 ? _a : []);\n if (programId === SYSTEM_PROGRAM_ID)\n throw new Error(`${label} contains unauthorized System Program instruction`);\n if (programId === BOUNDED_PROGRAM_MAINNET || programId === BOUNDED_PROGRAM_DEVNET) {\n boundedInstructionCount++;\n const parsed = parseBoundedSetDocumentsInstruction(data, label);\n if (parsed.appId !== expectedAppId)\n throw new Error(`${label} Bounded instruction appId does not match configured appId`);\n actualWritePaths.push(...parsed.documentPaths, ...parsed.deletePaths);\n }\n }\n if (boundedInstructionCount !== 1)\n throw new Error(`${label} must contain exactly one Bounded set-documents instruction`);\n assertSamePathSet(label, expectedWritePaths, actualWritePaths);\n return transaction;\n}\nexport async function handlePreBuiltTransaction(tx, authProvider, options, expectedWritePaths) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const { Connection, VersionedTransaction } = await import(\"@solana/web3.js\");\n // Honor a wallet client's immutable config snapshot for the expected app-id\n // binding and RPC endpoint (CTA-05); otherwise read the global init() config.\n const config = (_b = (_a = options === null || options === void 0 ? void 0 : options._overrides) === null || _a === void 0 ? void 0 : _a._config) !== null && _b !== void 0 ? _b : await getConfig();\n const transaction = deserializeAndValidateServerTransaction(tx.serializedTransaction, VersionedTransaction, {\n label: 'Pre-built transaction', expectedAppId: config.appId, expectedWritePaths,\n });\n const shouldSubmit = (options === null || options === void 0 ? void 0 : options.shouldSubmitTx) !== false;\n const rpcUrl = (_c = config.rpcUrl) === null || _c === void 0 ? void 0 : _c.trim();\n const injectedRpc = (_d = options === null || options === void 0 ? void 0 : options._overrides) === null || _d === void 0 ? void 0 : _d._solanaRpc;\n if (shouldSubmit && !rpcUrl && !injectedRpc) {\n throw new Error(`Pre-built Solana transaction submission requires init({ rpcUrl }) for ${tx.network}`);\n }\n const signedTx = await authProvider.signTransaction(transaction);\n const rawTx = signedTx.serialize();\n const signedTransaction = Buffer.from(rawTx).toString('base64');\n // Keep the worker's expiry fence instead of discarding it: it is what makes\n // bounded same-signature reconciliation (and therefore the retry-safe\n // `expired_not_landed` exit) possible at all.\n const fence = { blockhash: tx.blockhash, lastValidBlockHeight: tx.lastValidBlockHeight };\n if (!shouldSubmit) {\n // Signed and NOT sent. There is no signature and nothing to mirror.\n return { outcome: 'signed', lane: 'solana', transactionSignature: null, signedTransaction, fence };\n }\n // Derive the signature from the signed bytes BEFORE broadcasting, so a send\n // whose response is lost still yields a reconcilable identifier.\n const signature = deriveTransactionSignature(signedTx);\n const connection = injectedRpc !== null && injectedRpc !== void 0 ? injectedRpc : new Connection(rpcUrl, 'confirmed');\n try {\n await connection.sendRawTransaction(rawTx, { skipPreflight: false, maxRetries: 3 });\n }\n catch (error) {\n // A definitive rejection never entered the network — keep throwing.\n if (isDefinitiveSolanaSendFailure(error))\n throw error;\n // Ambiguous transport outcome: the node may hold these exact bytes. Report\n // the pre-derived signature so the caller reconciles it instead of building\n // a second transaction that could land beside the first.\n return {\n outcome: 'submitted',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n reason: `Broadcast response was lost or inconclusive: ${errorText(error)}`,\n };\n }\n let confirmation;\n try {\n confirmation = await connection.confirmTransaction({\n signature, blockhash: tx.blockhash, lastValidBlockHeight: tx.lastValidBlockHeight,\n }, 'confirmed');\n }\n catch (error) {\n // The bytes were accepted; only the confirmation outcome is unknown.\n return {\n outcome: 'submitted',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n reason: `Confirmation outcome unknown: ${errorText(error)}`,\n };\n }\n // #310: \"confirmed\" only means the network recorded the transaction, not that it\n // succeeded - a landed-but-failed transaction carries an err. Report it as a failure\n // (with on-chain logs) instead of a fake success, mirroring the server keypair provider.\n if ((_e = confirmation.value) === null || _e === void 0 ? void 0 : _e.err) {\n let logMessages;\n try {\n const txInfo = await connection.getTransaction(signature, {\n maxSupportedTransactionVersion: 0,\n commitment: 'confirmed',\n });\n logMessages = (_f = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _f === void 0 ? void 0 : _f.logMessages;\n }\n catch (_j) {\n // Log retrieval is diagnostic only; the on-chain error is the verdict.\n }\n const errorMessage = logMessages ? JSON.stringify(logMessages) : JSON.stringify(confirmation.value.err);\n throw new Error(`Transaction failed: ${errorMessage}`);\n }\n return {\n outcome: 'confirmed',\n lane: 'solana',\n transactionSignature: signature,\n signedTransaction,\n fence,\n confirmationContextSlot: (_h = (_g = confirmation.context) === null || _g === void 0 ? void 0 : _g.slot) !== null && _h !== void 0 ? _h : 0,\n };\n}\n"],"names":["Buffer","getConfig"],"mappings":";;;;;;;AAEA,MAAM,eAAe,GAAG,4DAA4D;AACpF;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;AAC1B,QAAQ,OAAO,EAAE;AACjB,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC;AACtB,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AAC9B,QAAQ,IAAI,KAAK,GAAG,IAAI;AACxB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAChD,YAAY,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,YAAY,MAAM,CAA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AG,CAAC;AAC/G,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC,CAAC;AAC9D,IAAI;AACJ,IAAI,OAAO;AACX,QAAQ,OAAO,EAAE,WAAW;AAC5B,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,oBAAoB,EAAE,SAAS;AACvC,QAAQ,iBAAiB;AACzB,QAAQ,KAAK;AACb,QAAQ,uBAAuB,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,YAAY,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,CAAC;AACnJ,KAAK;AACL;;;;;;"}
package/dist/types.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  import type { PublicKey, TransactionInstruction, Transaction, VersionedTransaction } from "@solana/web3.js";
2
- import type { SetOptions } from "./client/operations";
3
2
  import type { ClientConfig } from "./client/config";
4
3
  export interface AuthProvider {
5
4
  login(): Promise<User | null>;
6
- runTransaction(evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
7
5
  signMessage(message: string): Promise<string>;
8
6
  signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
9
7
  /**
@@ -23,18 +21,6 @@ export interface AuthProvider {
23
21
  restoreSession(): Promise<User | null>;
24
22
  logout(): Promise<void>;
25
23
  getNativeMethods(): Promise<any>;
26
- /**
27
- * Poll an already-broadcast EVM transaction through THIS provider's own
28
- * transport, so `reconcileSetResult` never has to guess an RPC endpoint or
29
- * cross wallet identities. Optional: a provider that cannot submit EVM
30
- * transactions has nothing to reconcile, and a `submitted` receipt simply
31
- * stays `submitted`.
32
- *
33
- * It must NEVER build a fresh transaction. It may rebroadcast the
34
- * byte-identical fenced bytes only when `allowRebroadcast` is true and the
35
- * fenced nonce is still unused.
36
- */
37
- reconcileEvmTransaction?(request: EvmReconcileRequest): Promise<TransactionReconciliation>;
38
24
  }
39
25
  export interface User {
40
26
  /**
@@ -85,28 +71,6 @@ export interface User {
85
71
  evmAddress?: string | null;
86
72
  provider: AuthProvider;
87
73
  }
88
- export interface EVMTransaction {
89
- contractAddress?: string;
90
- contractAbi?: string | any;
91
- functionName?: string;
92
- txArgs?: any[];
93
- /** Target contract (the per-chain BoundedRuntime address). */
94
- to?: string;
95
- /** ABI-encoded calldata (setDocuments(...)). */
96
- data?: string;
97
- /** Wei value to send with the call, as a decimal or 0x-hex string. Default "0". */
98
- value?: string;
99
- /** EIP-155 chain id the tx must execute on (used for the chain-switch guard). */
100
- chainId?: number;
101
- /** Optional gas limit hint (the worker's eth_estimateGas ×1.2). */
102
- gas?: string;
103
- /** Optional EIP-1559 max fee per gas. */
104
- maxFeePerGas?: string;
105
- /** Optional EIP-1559 max priority fee per gas. */
106
- maxPriorityFeePerGas?: string;
107
- /** Optional nonce; normally omitted so the signing wallet fills it. */
108
- nonce?: number;
109
- }
110
74
  export interface SolTransaction {
111
75
  appId: string;
112
76
  txArgs: any[];
@@ -123,16 +87,6 @@ export interface SolTransaction {
123
87
  * worker on its 202; the SDK never infers it from the app protocol.
124
88
  */
125
89
  export type SolanaChainTag = 'solana_devnet' | 'solana_mainnet';
126
- /**
127
- * Execution-lane tag for an EVM write, reported verbatim by the realtime worker
128
- * as the resolved EVM NETWORK key (protocol tier × chain), e.g. `base_sepolia`
129
- * on a testnet-tier app and `base_mainnet` on a mainnet-tier one. The
130
- * `evm_<chain>` form is the worker's fallback when a network cannot be resolved.
131
- *
132
- * The SDK never derives this from `evmTransaction.chainId`: a receipt states
133
- * where the write actually ran, and only the worker knows that.
134
- */
135
- export type EvmChainTag = 'base_sepolia' | 'base_mainnet' | 'robinhood_testnet' | 'robinhood_mainnet' | 'eth_sepolia' | 'eth_mainnet' | `evm_${string}`;
136
90
  /**
137
91
  * The execution lane a write actually ran on — NOT the app's declared protocol.
138
92
  * Routing is per batch, so a batch touching only unflagged collections in a
@@ -144,7 +98,7 @@ export type EvmChainTag = 'base_sepolia' | 'base_mainnet' | 'robinhood_testnet'
144
98
  * all. Discarding a committed write's receipt over a missing tag would be worse
145
99
  * than reporting the gap honestly.
146
100
  */
147
- export type ChainTag = SolanaChainTag | EvmChainTag | 'realtime_offchain' | 'unknown' | (string & {});
101
+ export type ChainTag = SolanaChainTag | 'realtime_offchain' | 'unknown' | (string & {});
148
102
  /**
149
103
  * One requested write, keyed by its CONCRETE destination path (never by index).
150
104
  * A `null` document means the entry was deleted or is absent.
@@ -164,18 +118,6 @@ export type SolanaFence = {
164
118
  blockhash: string;
165
119
  lastValidBlockHeight: number;
166
120
  };
167
- /**
168
- * EVM fence for a SERVER-KEYPAIR write: the exact signed bytes plus the sender
169
- * and nonce they consume. Reconciliation may rebroadcast these identical bytes
170
- * while the nonce is still unused, which cannot produce a second execution.
171
- * Injected browser wallets never produce one (the wallet holds the signed bytes).
172
- */
173
- export type EvmFence = {
174
- chainId: number;
175
- sender: string;
176
- nonce: number;
177
- signedTransaction: string;
178
- };
179
121
  /**
180
122
  * Whether server state was actually observed after a write.
181
123
  *
@@ -219,18 +161,7 @@ export type SolanaConfirmedSetResult = {
219
161
  confirmationContextSlot: number;
220
162
  mirrorSync: MirrorSync;
221
163
  };
222
- /** An EVM transaction whose receipt reported success. */
223
- export type EvmConfirmedSetResult = {
224
- status: 'confirmed';
225
- appId: string;
226
- requestedDocuments: SetDocuments;
227
- chain: EvmChainTag;
228
- transactionId: string;
229
- /** A real EVM block number. */
230
- blockNumber: number;
231
- mirrorSync: MirrorSync;
232
- };
233
- export type ConfirmedSetResult = SolanaConfirmedSetResult | EvmConfirmedSetResult;
164
+ export type ConfirmedSetResult = SolanaConfirmedSetResult;
234
165
  /**
235
166
  * Solana broadcast whose confirmation outcome is unknown. The signature is
236
167
  * derived from the signed bytes BEFORE broadcast, so it survives a lost send
@@ -249,63 +180,11 @@ export type SolanaSubmittedSetResult = {
249
180
  reason: string;
250
181
  };
251
182
  };
252
- /**
253
- * Server-keypair EVM broadcast with an unknown outcome. Fenced, so
254
- * reconciliation may rebroadcast the byte-identical signed transaction while
255
- * the nonce is unused. There is deliberately NO retry-safe terminal state here.
256
- */
257
- export type EvmFencedSubmittedSetResult = {
258
- status: 'submitted';
259
- appId: string;
260
- requestedDocuments: SetDocuments;
261
- chain: EvmChainTag;
262
- transactionId: string;
263
- fence: EvmFence;
264
- confirmation: {
265
- state: 'unknown';
266
- reason: string;
267
- };
268
- };
269
- /**
270
- * Injected-wallet EVM broadcast whose hash IS known (eth_sendTransaction
271
- * returned before receipt polling timed out). Pollable, never rebroadcastable:
272
- * the signed bytes live inside the wallet.
273
- */
274
- export type EvmHashKnownSubmittedSetResult = {
275
- status: 'submitted';
276
- appId: string;
277
- requestedDocuments: SetDocuments;
278
- chain: EvmChainTag;
279
- transactionId: string;
280
- rebroadcastable: false;
281
- confirmation: {
282
- state: 'unknown';
283
- reason: string;
284
- };
285
- };
286
- /**
287
- * Injected-wallet EVM send whose RESPONSE was lost, so no hash exists at all.
288
- * Explicitly irreconcilable and never auto-retried: the wallet owns nonce
289
- * selection and may have replaced the transaction outside our view.
290
- */
291
- export type EvmIrreconcilableSubmittedSetResult = {
292
- status: 'submitted';
293
- appId: string;
294
- requestedDocuments: SetDocuments;
295
- chain: EvmChainTag;
296
- transactionId: null;
297
- confirmation: {
298
- state: 'unknown';
299
- reason: string;
300
- reconcilable: false;
301
- };
302
- };
303
- export type SubmittedSetResult = SolanaSubmittedSetResult | EvmFencedSubmittedSetResult | EvmHashKnownSubmittedSetResult | EvmIrreconcilableSubmittedSetResult;
183
+ export type SubmittedSetResult = SolanaSubmittedSetResult;
304
184
  /**
305
185
  * The one retry-safe terminal state: the write provably did NOT land. Reached
306
186
  * only after observed blockhash expiry PLUS history proving the signature is
307
- * absent. Solana only — nonce advancement is not proof an EVM write did not
308
- * execute, so EVM has no equivalent by design.
187
+ * absent.
309
188
  */
310
189
  export type SolanaExpiredNotLandedSetResult = {
311
190
  status: 'expired_not_landed';
@@ -318,8 +197,7 @@ export type SolanaExpiredNotLandedSetResult = {
318
197
  /**
319
198
  * `shouldSubmitTx: false`: the transaction was signed and NOT sent. There is no
320
199
  * signature to report and nothing to mirror, so `transactionId` is `null` (not
321
- * an empty string) and no synchronization is attempted. Solana only — the EVM
322
- * providers sign and submit atomically.
200
+ * an empty string) and no synchronization is attempted.
323
201
  */
324
202
  export type SolanaSignedSetResult = {
325
203
  status: 'signed';
@@ -338,14 +216,14 @@ export type SolanaSignedSetResult = {
338
216
  * direct write is ambiguous. The SDK never retries writes for that reason;
339
217
  * resolve an ambiguous direct write by reading the path back, not by resubmitting.
340
218
  */
341
- export type SetResult = CommittedSetResult | SolanaConfirmedSetResult | EvmConfirmedSetResult | SolanaSubmittedSetResult | EvmFencedSubmittedSetResult | EvmHashKnownSubmittedSetResult | EvmIrreconcilableSubmittedSetResult | SolanaExpiredNotLandedSetResult | SolanaSignedSetResult;
219
+ export type SetResult = CommittedSetResult | SolanaConfirmedSetResult | SolanaSubmittedSetResult | SolanaExpiredNotLandedSetResult | SolanaSignedSetResult;
342
220
  /**
343
- * What `AuthProvider.runTransaction` (and the Solana pre-built lane) resolves
344
- * to. Discriminated so the identifier ESCAPES an unknown confirmation outcome:
221
+ * What the Solana pre-built write lane resolves to. Discriminated so the
222
+ * identifier ESCAPES an unknown confirmation outcome:
345
223
  * previously every lane awaited a receipt and threw on timeout, so a landed
346
224
  * transaction surfaced as an error with no hash and invited a duplicate submit.
347
225
  *
348
- * Definitive failures — an EIP-1193 user rejection, pre-broadcast validation,
226
+ * Definitive failures — a wallet user rejection, pre-broadcast validation,
349
227
  * or an on-chain revert/err — still THROW. Only an ambiguous transport outcome
350
228
  * resolves as `submitted`.
351
229
  */
@@ -375,51 +253,16 @@ export type SolanaSignedTransactionResult = {
375
253
  signedTransaction: string;
376
254
  fence: SolanaFence;
377
255
  };
378
- export type EvmConfirmedTransactionResult = {
379
- outcome: 'confirmed';
380
- lane: 'evm';
381
- transactionSignature: string;
382
- blockNumber: number;
383
- gasUsed: string;
384
- data?: unknown;
385
- };
386
- /** Server-keypair EVM: fenced, so the identical bytes may be rebroadcast. */
387
- export type EvmFencedSubmittedTransactionResult = {
388
- outcome: 'submitted';
389
- lane: 'evm';
390
- transactionSignature: string;
391
- fence: EvmFence;
392
- reason: string;
393
- };
394
- /** Injected wallet, hash known: pollable, never rebroadcastable. */
395
- export type EvmHashKnownSubmittedTransactionResult = {
396
- outcome: 'submitted';
397
- lane: 'evm';
398
- transactionSignature: string;
399
- rebroadcastable: false;
400
- reason: string;
401
- };
402
- /** Injected wallet, send response lost: no hash at all. */
403
- export type EvmIrreconcilableSubmittedTransactionResult = {
404
- outcome: 'submitted';
405
- lane: 'evm';
406
- transactionSignature: null;
407
- reconcilable: false;
408
- reason: string;
409
- };
410
256
  export type SolanaTransactionResult = SolanaConfirmedTransactionResult | SolanaSubmittedTransactionResult | SolanaSignedTransactionResult;
411
- export type EvmTransactionResult = EvmConfirmedTransactionResult | EvmFencedSubmittedTransactionResult | EvmHashKnownSubmittedTransactionResult | EvmIrreconcilableSubmittedTransactionResult;
412
- export type TransactionResult = SolanaTransactionResult | EvmTransactionResult;
257
+ export type TransactionResult = SolanaTransactionResult;
413
258
  /**
414
- * The result of polling an already-broadcast transaction. Providers implement
415
- * `reconcileEvmTransaction` to answer it for their own transport; Solana is
416
- * reconciled by core against the configured RPC.
259
+ * The result of polling an already-broadcast transaction. Solana is reconciled
260
+ * by core against the configured RPC.
417
261
  */
418
262
  export type TransactionReconciliation =
419
- /** A receipt/status exists and reports success. */
263
+ /** A confirmation/status exists and reports success. */
420
264
  {
421
265
  state: 'confirmed';
422
- blockNumber?: number;
423
266
  confirmationContextSlot?: number;
424
267
  }
425
268
  /** It landed and FAILED on-chain. The caller throws; this is not `submitted`. */
@@ -427,7 +270,7 @@ export type TransactionReconciliation =
427
270
  state: 'failed';
428
271
  reason: string;
429
272
  }
430
- /** Solana only: expiry observed AND history proves the signature is absent. */
273
+ /** Expiry observed AND history proves the signature is absent. */
431
274
  | {
432
275
  state: 'absent_after_expiry';
433
276
  }
@@ -468,17 +311,6 @@ export interface SolanaWriteRpc {
468
311
  }>;
469
312
  getBlockHeight?(commitment?: any): Promise<number>;
470
313
  }
471
- /** Request passed to a provider's `reconcileEvmTransaction`. */
472
- export type EvmReconcileRequest = {
473
- transactionHash: string;
474
- /** Present only for the fenced (server-keypair) receipt. */
475
- fence?: EvmFence;
476
- /**
477
- * Whether the caller permits a byte-identical rebroadcast of `fence`'s signed
478
- * transaction while its nonce is unused. Always false for injected wallets.
479
- */
480
- allowRebroadcast: boolean;
481
- };
482
314
  export interface TransactionReceipt {
483
315
  }
484
316
  export interface SubscriptionOptions {
@@ -5,8 +5,8 @@
5
5
  * event bus, so a session dying inside a session manager used to be invisible to
6
6
  * the SDK: `setCurrentUser(null)` was only ever called by `logout()` and `init()`.
7
7
  * The result was a UI that kept showing a connected wallet long after the session
8
- * it was showing had been wiped, which is exactly what let the Solana lab freeze a
9
- * review against a wallet the server no longer knew about.
8
+ * it was showing had been wiped, which is exactly what let a wallet-review UI
9
+ * freeze a review against a wallet the server no longer knew about.
10
10
  *
11
11
  * `js-sdk` registers a handler at init; core fires it ONLY when storage was
12
12
  * actually cleared, never on a failed-but-preserved refresh. Firing on a