{"version":3,"file":"solana-v1-operations-BPn-poee.mjs","sources":["../.rollup-tmp/client/solana-v1-operations.js"],"sourcesContent":["// solana-v1-operations.ts - the SIMD-0385 v1 half of the pre-built write lane.\n//\n// The realtime worker hands the SDK a serialized, possibly partially-signed\n// transaction (sponsor and attestation signatures may already be attached). For\n// v1 wires (first byte 0x81) @solana/web3.js's legacy/v0 classes cannot even\n// deserialize the bytes, so this lane decodes with @solana/kit, runs the SAME\n// semantic validation the v0 lane runs (program allow-list, setup-shape\n// recomputation, OA-0001 intent binding), refreshes the lifetime only while the\n// transaction is still unsigned, signs through the provider's `signTransactionV1`,\n// and submits base64 over the same RPC handle the v0 lane uses.\n//\n// Lazy-loaded: `@solana/kit` must never enter the SDK's initial chunk.\nimport { Buffer } from 'buffer';\nimport { getConfig } from './config';\nimport { BoundedOnchainRuleRejection, decodeBase58, encodeBase58, errorText, isBoundedOnchainRuleRejection, isDefinitiveSolanaSendFailure, validateServerTransactionSemantics, } from './solana-operations';\nimport { getTransactionJson } from './solana-transaction-read';\nfunction transactionHasSignature(transaction) {\n    return Object.values(transaction.signatures).some((sig) => !!sig && sig.some((byte) => byte !== 0));\n}\nfunction sameBytes(a, b) {\n    if (a.length !== b.length)\n        return false;\n    for (let i = 0; i < a.length; i += 1)\n        if (a[i] !== b[i])\n            return false;\n    return true;\n}\nasync function decodeAndValidate(serializedTransaction, options) {\n    const kit = await import('@solana/kit');\n    const transaction = kit.getTransactionDecoder().decode(Buffer.from(serializedTransaction, 'base64'));\n    const compiledMessage = kit.getCompiledTransactionMessageDecoder().decode(transaction.messageBytes);\n    if (compiledMessage.version !== 1) {\n        throw new Error(`${options.label} announced SIMD-0385 v1 but decoded as version ${String(compiledMessage.version)}`);\n    }\n    if (compiledMessage.instructionHeaders.length !== compiledMessage.instructionPayloads.length) {\n        throw new Error(`${options.label} has mismatched v1 instruction headers and payloads`);\n    }\n    const { PublicKey } = await import('@solana/web3.js');\n    const accountKeys = compiledMessage.staticAccounts.map((key) => new PublicKey(key));\n    const instructions = compiledMessage.instructionHeaders.map((header, index) => {\n        if (header.programAccountIndex >= accountKeys.length)\n            throw new Error(`${options.label} has an invalid program account index`);\n        const payload = compiledMessage.instructionPayloads[index];\n        return {\n            programId: accountKeys[header.programAccountIndex].toBase58(),\n            accountKeyIndexes: [...payload.instructionAccountIndices],\n            data: Uint8Array.from(payload.instructionData),\n        };\n    });\n    validateServerTransactionSemantics(Object.assign(Object.assign({}, options), { accountKeys, isAccountSigner: (index) => index >= 0 && index < compiledMessage.header.numSignerAccounts, instructions, PublicKeyCtor: PublicKey }));\n    return { transaction, compiledMessage, kit };\n}\n/**\n * LF-003 parity with the v0 lane: an UNSIGNED transaction is re-based on a live\n * blockhash before the wallet signs it; a transaction that already carries a\n * co-signer's signature must keep the exact message it was co-signed against,\n * and its fence must name that same blockhash.\n */\nasync function refreshLifetime(transaction, compiledMessage, kit, rpc, serverFence) {\n    var _a;\n    const fence = { blockhash: serverFence.blockhash, lastValidBlockHeight: serverFence.lastValidBlockHeight };\n    if (transactionHasSignature(transaction)) {\n        if (String(compiledMessage.lifetimeToken) !== fence.blockhash) {\n            throw new Error(`The pre-built v1 transaction was co-signed against blockhash ${String(compiledMessage.lifetimeToken)} ` +\n                `but its expiry fence names ${fence.blockhash}. Nothing was signed.`);\n        }\n        return { transaction, fence };\n    }\n    if (!rpc)\n        return { transaction, fence };\n    if (typeof rpc.getLatestBlockhash !== 'function') {\n        throw new Error('Pre-built v1 signing needs a current blockhash, but the configured Solana RPC cannot report one. Nothing was signed.');\n    }\n    const latest = await rpc.getLatestBlockhash('confirmed');\n    const decoded = decodeBase58(String((_a = latest === null || latest === void 0 ? void 0 : latest.blockhash) !== null && _a !== void 0 ? _a : ''));\n    if (decoded === null || decoded.length !== 32) {\n        throw new Error(`The configured Solana RPC returned \"${latest === null || latest === void 0 ? void 0 : latest.blockhash}\" as the current blockhash, which is not a 32-byte base58 value. Nothing was signed.`);\n    }\n    const decompiled = kit.decompileTransactionMessage(compiledMessage, { lastValidBlockHeight: BigInt(serverFence.lastValidBlockHeight) });\n    const refreshed = kit.setTransactionMessageLifetimeUsingBlockhash({ blockhash: kit.blockhash(latest.blockhash), lastValidBlockHeight: BigInt(latest.lastValidBlockHeight) }, decompiled);\n    return {\n        transaction: kit.compileTransaction(refreshed),\n        fence: { blockhash: latest.blockhash, lastValidBlockHeight: latest.lastValidBlockHeight },\n    };\n}\nexport async function handlePreBuiltV1Transaction(tx, authProvider, options, expectedIntent) {\n    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\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 decoded = await decodeAndValidate(tx.serializedTransaction, {\n        label: 'Pre-built v1 transaction', expectedAppId: config.appId, expectedIntent,\n    });\n    if (typeof authProvider.signTransactionV1 !== 'function') {\n        // The worker only builds v1 for a client that advertised it; reaching this\n        // means the provider changed underneath the write. Refuse before any RPC.\n        throw new Error('The write came back as a Solana transaction v1 (SIMD-0385) but this auth provider cannot sign v1. Nothing was signed.');\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            `Pass a TOP-LEVEL rpcUrl (with chain) to init(), e.g. ` +\n            `init({ appId, chain: '${tx.network}', rpcUrl: '<your ${tx.network} RPC endpoint>' }); ` +\n            `a nested walletLogin.rpcUrl only configures wallet login and does not enable submission.`);\n    }\n    const { Connection } = await import('@solana/web3.js');\n    const connection = injectedRpc !== null && injectedRpc !== void 0 ? injectedRpc : (rpcUrl ? new Connection(rpcUrl, 'confirmed') : null);\n    const refreshed = await refreshLifetime(decoded.transaction, decoded.compiledMessage, decoded.kit, connection, tx);\n    const signedTx = await authProvider.signTransactionV1(refreshed.transaction);\n    if (!sameBytes(signedTx.messageBytes, refreshed.transaction.messageBytes)) {\n        throw new Error('The signer changed the v1 transaction message instead of signing the exact transaction. Nothing was submitted.');\n    }\n    const feePayerAddress = String((_e = decoded.compiledMessage.staticAccounts[0]) !== null && _e !== void 0 ? _e : '');\n    const feePayerSignature = signedTx.signatures[feePayerAddress];\n    const rawTx = Uint8Array.from(decoded.kit.getTransactionEncoder().encode(signedTx));\n    const signedTransaction = Buffer.from(rawTx).toString('base64');\n    if (!shouldSubmit) {\n        return { outcome: 'signed', lane: 'solana', transactionSignature: null, signedTransaction, fence: refreshed.fence };\n    }\n    if (!feePayerSignature || feePayerSignature.every((byte) => byte === 0)) {\n        throw new Error('The signed v1 transaction carries no fee-payer signature; it cannot be submitted.');\n    }\n    // The transaction id is the fee payer's signature, derived from the signed bytes\n    // BEFORE broadcasting so a lost send response still yields a reconcilable id.\n    const signature = encodeBase58(Uint8Array.from(feePayerSignature));\n    const submitRpc = connection;\n    try {\n        await submitRpc.sendRawTransaction(rawTx, { skipPreflight: false, maxRetries: 3 });\n    }\n    catch (error) {\n        if (isDefinitiveSolanaSendFailure(error)) {\n            if (isBoundedOnchainRuleRejection(error))\n                throw new BoundedOnchainRuleRejection(error);\n            throw error;\n        }\n        return {\n            outcome: 'submitted', lane: 'solana', transactionSignature: signature, signedTransaction, fence: refreshed.fence,\n            reason: `Broadcast response was lost or inconclusive: ${errorText(error)}`,\n        };\n    }\n    let confirmation;\n    try {\n        confirmation = await submitRpc.confirmTransaction({ signature, blockhash: refreshed.fence.blockhash, lastValidBlockHeight: refreshed.fence.lastValidBlockHeight }, 'confirmed');\n    }\n    catch (error) {\n        return {\n            outcome: 'submitted', lane: 'solana', transactionSignature: signature, signedTransaction, fence: refreshed.fence,\n            reason: `Confirmation outcome unknown: ${errorText(error)}`,\n        };\n    }\n    if ((_f = confirmation.value) === null || _f === void 0 ? void 0 : _f.err) {\n        let logMessages;\n        try {\n            logMessages = (_h = (_g = (await getTransactionJson(submitRpc, signature, 'confirmed'))) === null || _g === void 0 ? void 0 : _g.meta) === null || _h === void 0 ? void 0 : _h.logMessages;\n        }\n        catch (_l) {\n            // Diagnostic only; the on-chain error is the verdict.\n        }\n        if (isBoundedOnchainRuleRejection(confirmation.value.err, logMessages)) {\n            throw new BoundedOnchainRuleRejection(confirmation.value.err, logMessages);\n        }\n        throw new Error(`Transaction failed: ${logMessages ? JSON.stringify(logMessages) : JSON.stringify(confirmation.value.err)}`);\n    }\n    return {\n        outcome: 'confirmed', lane: 'solana', transactionSignature: signature, signedTransaction, fence: refreshed.fence,\n        confirmationContextSlot: (_k = (_j = confirmation.context) === null || _j === void 0 ? void 0 : _j.slot) !== null && _k !== void 0 ? _k : 0,\n    };\n}\n"],"names":["Buffer"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,SAAS,uBAAuB,CAAC,WAAW,EAAE;AAC9C,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;AACvG;AACA,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;AACzB,IAAI,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;AAC7B,QAAQ,OAAO,KAAK;AACpB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;AACxC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACzB,YAAY,OAAO,KAAK;AACx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