From c95b70dbb93e9da480dadbcc1abc79ea1d9cda63 Mon Sep 17 00:00:00 2001 From: Ashwin-3cS Date: Wed, 8 Apr 2026 16:07:47 +0530 Subject: [PATCH] Guard patchGasCoinIntents behind enokiApiKey check In direct-sign mode (no ENOKI_API_KEY) the patch breaks gas selection. Only apply when Enoki sponsorship is actually enabled. --- services/server/scripts/sidecar-server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/server/scripts/sidecar-server.ts b/services/server/scripts/sidecar-server.ts index 91a68962..c1f09ecf 100644 --- a/services/server/scripts/sidecar-server.ts +++ b/services/server/scripts/sidecar-server.ts @@ -795,7 +795,11 @@ app.post("/walrus/upload", express.json({ limit: JSON_LIMIT_WALRUS_UPLOAD }), as // Patch: convert GasCoin intents → sender's SUI coins. // Enoki rejects GasCoin as tx argument, but relay requires the tip. // After patching, signer pays tip from own SUI; Enoki sponsors gas. - patchGasCoinIntents(registerTx); + // Only apply when Enoki sponsorship is enabled — direct signing + // resolves gas normally and the patch would break it. + if (enokiApiKey) { + patchGasCoinIntents(registerTx); + } const tipRecipient = await getUploadRelayTipAddress(); const registerAllowedAddresses = dedupeAddresses([signerAddress, tipRecipient]); const registerDigest = await submitWalletTransaction(