@bounded-sh/core 0.0.67 → 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.
- package/README.md +0 -1
- package/dist/client/config.d.ts +4 -8
- package/dist/client/operations.d.ts +0 -3
- package/dist/client/reconcile.d.ts +7 -16
- package/dist/client/subscribe-query.d.ts +12 -1
- package/dist/{index-TyXiW4Uf.mjs → index-B3aNfGi6.mjs} +80 -634
- package/dist/index-B3aNfGi6.mjs.map +1 -0
- package/dist/{index-DNZifL5j.js → index-DlJKTmRv.js} +81 -637
- package/dist/index-DlJKTmRv.js.map +1 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{realtime-store-CINyAkPw.js → realtime-store-CkgpUOrE.js} +2 -2
- package/dist/{realtime-store-CINyAkPw.js.map → realtime-store-CkgpUOrE.js.map} +1 -1
- package/dist/{realtime-store-CpbnXM7q.mjs → realtime-store-i8pxSuZE.mjs} +2 -2
- package/dist/{realtime-store-CpbnXM7q.mjs.map → realtime-store-i8pxSuZE.mjs.map} +1 -1
- package/dist/{solana-message-DXXwC95Z.mjs → solana-message-AXfv2U1S.mjs} +2 -2
- package/dist/{solana-message-DXXwC95Z.mjs.map → solana-message-AXfv2U1S.mjs.map} +1 -1
- package/dist/{solana-message-Bycv-L5n.js → solana-message-DnV4FQ__.js} +2 -2
- package/dist/{solana-message-Bycv-L5n.js.map → solana-message-DnV4FQ__.js.map} +1 -1
- package/dist/{solana-operations-ChHG25O0.mjs → solana-operations-Bte92rmq.mjs} +2 -2
- package/dist/{solana-operations-ChHG25O0.mjs.map → solana-operations-Bte92rmq.mjs.map} +1 -1
- package/dist/{solana-operations-Dm_4VnlB.js → solana-operations-DPul1dWo.js} +2 -2
- package/dist/{solana-operations-Dm_4VnlB.js.map → solana-operations-DPul1dWo.js.map} +1 -1
- package/dist/types.d.ts +21 -186
- package/dist/utils/session-events.d.ts +2 -2
- package/package.json +2 -2
- package/dist/index-DNZifL5j.js.map +0 -1
- package/dist/index-TyXiW4Uf.mjs.map +0 -1
- package/dist/utils/evm/evm-transaction-validation.d.ts +0 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana-operations-ChHG25O0.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,KAAK,GAAG,EAAE;AAClC,YAAY,KAAK,GAAG,CAAC,KA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Y,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,IAAI,IAAI,KAAK,EAAE;AAC9B,QAAQ,IAA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,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-
|
|
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-
|
|
339
|
+
//# sourceMappingURL=solana-operations-DPul1dWo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana-operations-Dm_4VnlB.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,GAA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AAiB;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-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,CA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AAI,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;;;;;;"}
|
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
|
/**
|
|
@@ -50,11 +36,14 @@ export interface User {
|
|
|
50
36
|
*/
|
|
51
37
|
id?: string;
|
|
52
38
|
/**
|
|
53
|
-
* REAL onchain wallet address. Present for wallet/SIWS
|
|
54
|
-
* email/social logins through the default Turnkey
|
|
55
|
-
*
|
|
39
|
+
* REAL onchain wallet address (the Solana wallet). Present for wallet/SIWS
|
|
40
|
+
* logins and normally for email/social logins through the default Turnkey
|
|
41
|
+
* wallet. `null` for EVM-wallet (SIWE) logins and explicit wallet opt-out,
|
|
42
|
+
* where the session has no Solana address - narrow before any string or
|
|
43
|
+
* PublicKey use. Kept for backwards compatibility: for wallet users
|
|
44
|
+
* `id === address`.
|
|
56
45
|
*/
|
|
57
|
-
address: string;
|
|
46
|
+
address: string | null;
|
|
58
47
|
/**
|
|
59
48
|
* Verified, lowercased email of the user — present only for email-login
|
|
60
49
|
* (Bounded Better Auth) sessions; `null`/absent for wallet/SIWS sessions.
|
|
@@ -82,28 +71,6 @@ export interface User {
|
|
|
82
71
|
evmAddress?: string | null;
|
|
83
72
|
provider: AuthProvider;
|
|
84
73
|
}
|
|
85
|
-
export interface EVMTransaction {
|
|
86
|
-
contractAddress?: string;
|
|
87
|
-
contractAbi?: string | any;
|
|
88
|
-
functionName?: string;
|
|
89
|
-
txArgs?: any[];
|
|
90
|
-
/** Target contract (the per-chain BoundedRuntime address). */
|
|
91
|
-
to?: string;
|
|
92
|
-
/** ABI-encoded calldata (setDocuments(...)). */
|
|
93
|
-
data?: string;
|
|
94
|
-
/** Wei value to send with the call, as a decimal or 0x-hex string. Default "0". */
|
|
95
|
-
value?: string;
|
|
96
|
-
/** EIP-155 chain id the tx must execute on (used for the chain-switch guard). */
|
|
97
|
-
chainId?: number;
|
|
98
|
-
/** Optional gas limit hint (the worker's eth_estimateGas ×1.2). */
|
|
99
|
-
gas?: string;
|
|
100
|
-
/** Optional EIP-1559 max fee per gas. */
|
|
101
|
-
maxFeePerGas?: string;
|
|
102
|
-
/** Optional EIP-1559 max priority fee per gas. */
|
|
103
|
-
maxPriorityFeePerGas?: string;
|
|
104
|
-
/** Optional nonce; normally omitted so the signing wallet fills it. */
|
|
105
|
-
nonce?: number;
|
|
106
|
-
}
|
|
107
74
|
export interface SolTransaction {
|
|
108
75
|
appId: string;
|
|
109
76
|
txArgs: any[];
|
|
@@ -120,16 +87,6 @@ export interface SolTransaction {
|
|
|
120
87
|
* worker on its 202; the SDK never infers it from the app protocol.
|
|
121
88
|
*/
|
|
122
89
|
export type SolanaChainTag = 'solana_devnet' | 'solana_mainnet';
|
|
123
|
-
/**
|
|
124
|
-
* Execution-lane tag for an EVM write, reported verbatim by the realtime worker
|
|
125
|
-
* as the resolved EVM NETWORK key (protocol tier × chain), e.g. `base_sepolia`
|
|
126
|
-
* on a testnet-tier app and `base_mainnet` on a mainnet-tier one. The
|
|
127
|
-
* `evm_<chain>` form is the worker's fallback when a network cannot be resolved.
|
|
128
|
-
*
|
|
129
|
-
* The SDK never derives this from `evmTransaction.chainId`: a receipt states
|
|
130
|
-
* where the write actually ran, and only the worker knows that.
|
|
131
|
-
*/
|
|
132
|
-
export type EvmChainTag = 'base_sepolia' | 'base_mainnet' | 'robinhood_testnet' | 'robinhood_mainnet' | 'eth_sepolia' | 'eth_mainnet' | `evm_${string}`;
|
|
133
90
|
/**
|
|
134
91
|
* The execution lane a write actually ran on — NOT the app's declared protocol.
|
|
135
92
|
* Routing is per batch, so a batch touching only unflagged collections in a
|
|
@@ -141,7 +98,7 @@ export type EvmChainTag = 'base_sepolia' | 'base_mainnet' | 'robinhood_testnet'
|
|
|
141
98
|
* all. Discarding a committed write's receipt over a missing tag would be worse
|
|
142
99
|
* than reporting the gap honestly.
|
|
143
100
|
*/
|
|
144
|
-
export type ChainTag = SolanaChainTag |
|
|
101
|
+
export type ChainTag = SolanaChainTag | 'realtime_offchain' | 'unknown' | (string & {});
|
|
145
102
|
/**
|
|
146
103
|
* One requested write, keyed by its CONCRETE destination path (never by index).
|
|
147
104
|
* A `null` document means the entry was deleted or is absent.
|
|
@@ -161,18 +118,6 @@ export type SolanaFence = {
|
|
|
161
118
|
blockhash: string;
|
|
162
119
|
lastValidBlockHeight: number;
|
|
163
120
|
};
|
|
164
|
-
/**
|
|
165
|
-
* EVM fence for a SERVER-KEYPAIR write: the exact signed bytes plus the sender
|
|
166
|
-
* and nonce they consume. Reconciliation may rebroadcast these identical bytes
|
|
167
|
-
* while the nonce is still unused, which cannot produce a second execution.
|
|
168
|
-
* Injected browser wallets never produce one (the wallet holds the signed bytes).
|
|
169
|
-
*/
|
|
170
|
-
export type EvmFence = {
|
|
171
|
-
chainId: number;
|
|
172
|
-
sender: string;
|
|
173
|
-
nonce: number;
|
|
174
|
-
signedTransaction: string;
|
|
175
|
-
};
|
|
176
121
|
/**
|
|
177
122
|
* Whether server state was actually observed after a write.
|
|
178
123
|
*
|
|
@@ -216,18 +161,7 @@ export type SolanaConfirmedSetResult = {
|
|
|
216
161
|
confirmationContextSlot: number;
|
|
217
162
|
mirrorSync: MirrorSync;
|
|
218
163
|
};
|
|
219
|
-
|
|
220
|
-
export type EvmConfirmedSetResult = {
|
|
221
|
-
status: 'confirmed';
|
|
222
|
-
appId: string;
|
|
223
|
-
requestedDocuments: SetDocuments;
|
|
224
|
-
chain: EvmChainTag;
|
|
225
|
-
transactionId: string;
|
|
226
|
-
/** A real EVM block number. */
|
|
227
|
-
blockNumber: number;
|
|
228
|
-
mirrorSync: MirrorSync;
|
|
229
|
-
};
|
|
230
|
-
export type ConfirmedSetResult = SolanaConfirmedSetResult | EvmConfirmedSetResult;
|
|
164
|
+
export type ConfirmedSetResult = SolanaConfirmedSetResult;
|
|
231
165
|
/**
|
|
232
166
|
* Solana broadcast whose confirmation outcome is unknown. The signature is
|
|
233
167
|
* derived from the signed bytes BEFORE broadcast, so it survives a lost send
|
|
@@ -246,63 +180,11 @@ export type SolanaSubmittedSetResult = {
|
|
|
246
180
|
reason: string;
|
|
247
181
|
};
|
|
248
182
|
};
|
|
249
|
-
|
|
250
|
-
* Server-keypair EVM broadcast with an unknown outcome. Fenced, so
|
|
251
|
-
* reconciliation may rebroadcast the byte-identical signed transaction while
|
|
252
|
-
* the nonce is unused. There is deliberately NO retry-safe terminal state here.
|
|
253
|
-
*/
|
|
254
|
-
export type EvmFencedSubmittedSetResult = {
|
|
255
|
-
status: 'submitted';
|
|
256
|
-
appId: string;
|
|
257
|
-
requestedDocuments: SetDocuments;
|
|
258
|
-
chain: EvmChainTag;
|
|
259
|
-
transactionId: string;
|
|
260
|
-
fence: EvmFence;
|
|
261
|
-
confirmation: {
|
|
262
|
-
state: 'unknown';
|
|
263
|
-
reason: string;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
/**
|
|
267
|
-
* Injected-wallet EVM broadcast whose hash IS known (eth_sendTransaction
|
|
268
|
-
* returned before receipt polling timed out). Pollable, never rebroadcastable:
|
|
269
|
-
* the signed bytes live inside the wallet.
|
|
270
|
-
*/
|
|
271
|
-
export type EvmHashKnownSubmittedSetResult = {
|
|
272
|
-
status: 'submitted';
|
|
273
|
-
appId: string;
|
|
274
|
-
requestedDocuments: SetDocuments;
|
|
275
|
-
chain: EvmChainTag;
|
|
276
|
-
transactionId: string;
|
|
277
|
-
rebroadcastable: false;
|
|
278
|
-
confirmation: {
|
|
279
|
-
state: 'unknown';
|
|
280
|
-
reason: string;
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
/**
|
|
284
|
-
* Injected-wallet EVM send whose RESPONSE was lost, so no hash exists at all.
|
|
285
|
-
* Explicitly irreconcilable and never auto-retried: the wallet owns nonce
|
|
286
|
-
* selection and may have replaced the transaction outside our view.
|
|
287
|
-
*/
|
|
288
|
-
export type EvmIrreconcilableSubmittedSetResult = {
|
|
289
|
-
status: 'submitted';
|
|
290
|
-
appId: string;
|
|
291
|
-
requestedDocuments: SetDocuments;
|
|
292
|
-
chain: EvmChainTag;
|
|
293
|
-
transactionId: null;
|
|
294
|
-
confirmation: {
|
|
295
|
-
state: 'unknown';
|
|
296
|
-
reason: string;
|
|
297
|
-
reconcilable: false;
|
|
298
|
-
};
|
|
299
|
-
};
|
|
300
|
-
export type SubmittedSetResult = SolanaSubmittedSetResult | EvmFencedSubmittedSetResult | EvmHashKnownSubmittedSetResult | EvmIrreconcilableSubmittedSetResult;
|
|
183
|
+
export type SubmittedSetResult = SolanaSubmittedSetResult;
|
|
301
184
|
/**
|
|
302
185
|
* The one retry-safe terminal state: the write provably did NOT land. Reached
|
|
303
186
|
* only after observed blockhash expiry PLUS history proving the signature is
|
|
304
|
-
* absent.
|
|
305
|
-
* execute, so EVM has no equivalent by design.
|
|
187
|
+
* absent.
|
|
306
188
|
*/
|
|
307
189
|
export type SolanaExpiredNotLandedSetResult = {
|
|
308
190
|
status: 'expired_not_landed';
|
|
@@ -315,8 +197,7 @@ export type SolanaExpiredNotLandedSetResult = {
|
|
|
315
197
|
/**
|
|
316
198
|
* `shouldSubmitTx: false`: the transaction was signed and NOT sent. There is no
|
|
317
199
|
* signature to report and nothing to mirror, so `transactionId` is `null` (not
|
|
318
|
-
* an empty string) and no synchronization is attempted.
|
|
319
|
-
* providers sign and submit atomically.
|
|
200
|
+
* an empty string) and no synchronization is attempted.
|
|
320
201
|
*/
|
|
321
202
|
export type SolanaSignedSetResult = {
|
|
322
203
|
status: 'signed';
|
|
@@ -335,14 +216,14 @@ export type SolanaSignedSetResult = {
|
|
|
335
216
|
* direct write is ambiguous. The SDK never retries writes for that reason;
|
|
336
217
|
* resolve an ambiguous direct write by reading the path back, not by resubmitting.
|
|
337
218
|
*/
|
|
338
|
-
export type SetResult = CommittedSetResult | SolanaConfirmedSetResult |
|
|
219
|
+
export type SetResult = CommittedSetResult | SolanaConfirmedSetResult | SolanaSubmittedSetResult | SolanaExpiredNotLandedSetResult | SolanaSignedSetResult;
|
|
339
220
|
/**
|
|
340
|
-
* What
|
|
341
|
-
*
|
|
221
|
+
* What the Solana pre-built write lane resolves to. Discriminated so the
|
|
222
|
+
* identifier ESCAPES an unknown confirmation outcome:
|
|
342
223
|
* previously every lane awaited a receipt and threw on timeout, so a landed
|
|
343
224
|
* transaction surfaced as an error with no hash and invited a duplicate submit.
|
|
344
225
|
*
|
|
345
|
-
* Definitive failures —
|
|
226
|
+
* Definitive failures — a wallet user rejection, pre-broadcast validation,
|
|
346
227
|
* or an on-chain revert/err — still THROW. Only an ambiguous transport outcome
|
|
347
228
|
* resolves as `submitted`.
|
|
348
229
|
*/
|
|
@@ -372,51 +253,16 @@ export type SolanaSignedTransactionResult = {
|
|
|
372
253
|
signedTransaction: string;
|
|
373
254
|
fence: SolanaFence;
|
|
374
255
|
};
|
|
375
|
-
export type EvmConfirmedTransactionResult = {
|
|
376
|
-
outcome: 'confirmed';
|
|
377
|
-
lane: 'evm';
|
|
378
|
-
transactionSignature: string;
|
|
379
|
-
blockNumber: number;
|
|
380
|
-
gasUsed: string;
|
|
381
|
-
data?: unknown;
|
|
382
|
-
};
|
|
383
|
-
/** Server-keypair EVM: fenced, so the identical bytes may be rebroadcast. */
|
|
384
|
-
export type EvmFencedSubmittedTransactionResult = {
|
|
385
|
-
outcome: 'submitted';
|
|
386
|
-
lane: 'evm';
|
|
387
|
-
transactionSignature: string;
|
|
388
|
-
fence: EvmFence;
|
|
389
|
-
reason: string;
|
|
390
|
-
};
|
|
391
|
-
/** Injected wallet, hash known: pollable, never rebroadcastable. */
|
|
392
|
-
export type EvmHashKnownSubmittedTransactionResult = {
|
|
393
|
-
outcome: 'submitted';
|
|
394
|
-
lane: 'evm';
|
|
395
|
-
transactionSignature: string;
|
|
396
|
-
rebroadcastable: false;
|
|
397
|
-
reason: string;
|
|
398
|
-
};
|
|
399
|
-
/** Injected wallet, send response lost: no hash at all. */
|
|
400
|
-
export type EvmIrreconcilableSubmittedTransactionResult = {
|
|
401
|
-
outcome: 'submitted';
|
|
402
|
-
lane: 'evm';
|
|
403
|
-
transactionSignature: null;
|
|
404
|
-
reconcilable: false;
|
|
405
|
-
reason: string;
|
|
406
|
-
};
|
|
407
256
|
export type SolanaTransactionResult = SolanaConfirmedTransactionResult | SolanaSubmittedTransactionResult | SolanaSignedTransactionResult;
|
|
408
|
-
export type
|
|
409
|
-
export type TransactionResult = SolanaTransactionResult | EvmTransactionResult;
|
|
257
|
+
export type TransactionResult = SolanaTransactionResult;
|
|
410
258
|
/**
|
|
411
|
-
* The result of polling an already-broadcast transaction.
|
|
412
|
-
*
|
|
413
|
-
* 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.
|
|
414
261
|
*/
|
|
415
262
|
export type TransactionReconciliation =
|
|
416
|
-
/** A
|
|
263
|
+
/** A confirmation/status exists and reports success. */
|
|
417
264
|
{
|
|
418
265
|
state: 'confirmed';
|
|
419
|
-
blockNumber?: number;
|
|
420
266
|
confirmationContextSlot?: number;
|
|
421
267
|
}
|
|
422
268
|
/** It landed and FAILED on-chain. The caller throws; this is not `submitted`. */
|
|
@@ -424,7 +270,7 @@ export type TransactionReconciliation =
|
|
|
424
270
|
state: 'failed';
|
|
425
271
|
reason: string;
|
|
426
272
|
}
|
|
427
|
-
/**
|
|
273
|
+
/** Expiry observed AND history proves the signature is absent. */
|
|
428
274
|
| {
|
|
429
275
|
state: 'absent_after_expiry';
|
|
430
276
|
}
|
|
@@ -465,17 +311,6 @@ export interface SolanaWriteRpc {
|
|
|
465
311
|
}>;
|
|
466
312
|
getBlockHeight?(commitment?: any): Promise<number>;
|
|
467
313
|
}
|
|
468
|
-
/** Request passed to a provider's `reconcileEvmTransaction`. */
|
|
469
|
-
export type EvmReconcileRequest = {
|
|
470
|
-
transactionHash: string;
|
|
471
|
-
/** Present only for the fenced (server-keypair) receipt. */
|
|
472
|
-
fence?: EvmFence;
|
|
473
|
-
/**
|
|
474
|
-
* Whether the caller permits a byte-identical rebroadcast of `fence`'s signed
|
|
475
|
-
* transaction while its nonce is unused. Always false for injected wallets.
|
|
476
|
-
*/
|
|
477
|
-
allowRebroadcast: boolean;
|
|
478
|
-
};
|
|
479
314
|
export interface TransactionReceipt {
|
|
480
315
|
}
|
|
481
316
|
export interface SubscriptionOptions {
|