Disable Utila/Fireblocks, use native MPC only; fix bridge-ui build

- Remove Utila route and webhook path rewrite from server.ts
- Make Utila gRPC client lazy via Proxy (only initializes if credentials present)
- Add NEXT_PUBLIC_BACKEND_API build-time env to bridge-ui Dockerfile
- Add postcss-import dev dependency for build compatibility
This commit is contained in:
2026-02-24 10:17:55 -08:00
parent 3c739f7d44
commit 90ff6cc17e
5 changed files with 48 additions and 37 deletions
+2
View File
@@ -42,6 +42,8 @@ ENV NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=000000000000
ENV NEXT_PUBLIC_FIREBASE_APP_ID=1:000000000000:web:placeholder
ENV NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=G-PLACEHOLDER
ENV NEXT_PUBLIC_IDENTITY_API=https://identity.lux.network
ENV NEXT_PUBLIC_BACKEND_API=https://bridge.lux.network
ENV NEXT_PUBLIC_API_VERSION=mainnet
# Build the application with increased heap
RUN cd app/bridge && NODE_OPTIONS="--max_old_space_size=4096" pnpm run build
+2 -1
View File
@@ -115,7 +115,8 @@
"chromatic": "^6.24.1",
"cross-env": "^7.0.3",
"postcss": "^8.4.33",
"postcss-nesting": "^12.0.2",
"postcss-import": "^16.0.0",
"postcss-nesting": "^12.1.5",
"prisma-erd-generator": "^1.11.2",
"storybook": "^7.4.5",
"storybook-addon-mock": "^4.3.0",
+18 -20
View File
@@ -10,28 +10,26 @@ import logger from "@/logger"
import { UTILA_NETWORKS } from "@/domain/constants"
import { handlerDepositAction } from "./swaps"
// Ensure required environment variables are set
const validateEnv = (): void => {
const requiredEnvVars = ["SERVICE_ACCOUNT_EMAIL", "SERVICE_ACCOUNT_PRIVATE_KEY"]
let missingVars: string[] = []
requiredEnvVars.forEach((key) => {
if (!process.env[key]) missingVars.push(key)
})
// Utila/Fireblocks disabled — using native MPC only
// Client is created lazily only if credentials are present
let _client: any = null
if (missingVars.length > 0) {
logger.warn(`Utila integration is missing the following environment variables: ${missingVars.join(", ")}`)
export const client = new Proxy({} as any, {
get(_target, prop) {
if (!_client) {
if (!process.env.SERVICE_ACCOUNT_EMAIL || !process.env.SERVICE_ACCOUNT_PRIVATE_KEY) {
throw new Error("Utila is disabled — SERVICE_ACCOUNT_EMAIL and SERVICE_ACCOUNT_PRIVATE_KEY not configured")
}
_client = createGrpcClient({
authStrategy: serviceAccountAuthStrategy({
email: process.env.SERVICE_ACCOUNT_EMAIL as string,
privateKey: async () => process.env.SERVICE_ACCOUNT_PRIVATE_KEY as string
})
}).version("v1alpha2")
}
return (_client as any)[prop]
}
}
validateEnv()
// utila grpc client
export const client = createGrpcClient({
authStrategy: serviceAccountAuthStrategy({
email: process.env.SERVICE_ACCOUNT_EMAIL as string,
privateKey: async () => process.env.SERVICE_ACCOUNT_PRIVATE_KEY as string
})
}).version("v1alpha2")
})
export const utilaPublicKey = `
-----BEGIN PUBLIC KEY-----
+2 -12
View File
@@ -12,7 +12,8 @@ import tokens from "@/routes/tokens"
import limits from "@/routes/limits"
import quote from "@/routes/quote"
import rate from "@/routes/rate"
import utila from "@/routes/utila"
// Utila/Fireblocks disabled — using native MPC only
// import utila from "@/routes/utila"
import networks from "@/routes/networks"
import exchanges from "@/routes/exchanges"
import { mpcService } from "@/services/mpc-service"
@@ -61,17 +62,6 @@ try {
// next()
// })
// Backwards compatibility for legacy webhook paths
app.use((req: Request, res: Response, next: NextFunction) => {
if (req.method === "POST" && req.path === "/webhook/utila") {
logger.info(`Rewriting request path: ${req.path} -> /v1/utila/webhook`)
req.url = "/v1/utila/webhook" // Rewrite the request path
}
next()
})
// add utila webhook router
app.use("/v1/utila", utila)
// Parses incoming JSON requests and puts the parsed data in req.body
app.use(express.json({
verify: (req, res, buf) => {
+24 -4
View File
@@ -345,8 +345,11 @@ importers:
postcss:
specifier: ^8.4.33
version: 8.4.49
postcss-import:
specifier: ^16.0.0
version: 16.1.0([email protected])
postcss-nesting:
specifier: ^12.0.2
specifier: ^12.1.5
version: 12.1.5([email protected])
prisma-erd-generator:
specifier: ^1.11.2
@@ -6504,6 +6507,7 @@ packages:
'@walletconnect/[email protected]':
resolution: {integrity: sha512-OzOWxRTfVGCHU3OOF6ibPkgPfDpivFJjuknfcOUt9PYWpTAv6YKOmT4cyfBPhc7llruyHpV44fYbykMcLIvEcg==}
deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
'@walletconnect/[email protected]':
resolution: {integrity: sha512-anRwnXKlR08lYllFMEarS01hp1gr6Q9XUgvacr749hoaC/AwGVlxYFdM8+MyYr3ozlA+2i599kjbK/mAebqdXg==}
@@ -6533,12 +6537,15 @@ packages:
'@walletconnect/[email protected]':
resolution: {integrity: sha512-zgJv8jDvIMP4Qse/D9oIRXGdfoNqonsrjPZanQ/CHNe7oXGOBiQND2IIeX+tS0H7uNA0TPvctljCLiIN9nw4eA==}
deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
'@walletconnect/[email protected]':
resolution: {integrity: sha512-d3V5Be7AqLrvzcdMZSBS8DmGDRdqnyLk1DWmRKAGgR6ieUWykhhUKlvfeoZtvJrIXrY7rUGYpH1X41UtFkW5Pw==}
deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
'@walletconnect/[email protected]':
resolution: {integrity: sha512-JmaolkO8D31UdRaQCHwlr8uIFUI5BYhBzqYFt54Mc6gbIa1tijGOmdyr6YhhFO70LPmS6gHIjljwOuEllmlrxw==}
deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
'@walletconnect/[email protected]':
resolution: {integrity: sha512-zExzp8Mj1YiAIBfKNm5u622oNw44WOESzo6hj+Q3apSMIb0Jph9X3GDIdbZmvVZsNPxWDL7uodKgZcCInZv2vA==}
@@ -9611,16 +9618,17 @@ packages:
[email protected]:
resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]
hasBin: true
[email protected]:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
deprecated: Glob versions prior to v9 are no longer supported
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]
[email protected]:
resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
engines: {node: '>=12'}
deprecated: Glob versions prior to v9 are no longer supported
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]
[email protected]:
resolution: {integrity: sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==}
@@ -10625,6 +10633,7 @@ packages:
[email protected]:
resolution: {integrity: sha512-SiSJQ805W1sDUCD1+/t1/1BIrveq2Fe9HJqENxZmMCILmrPI7WhS/pePpIOx85v6/H2z1Vy7AI08GV2TzfXocg==}
deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
[email protected]:
resolution: {integrity: sha512-rAffKbPoNDjuRnXkecTjnsE3xLLrb00rEkdgalINhaYVYIxDwWtvYBr9UFbhTvPB1B2qUOLoFd/cV6f4Q7mh7g==}
@@ -11778,6 +11787,7 @@ packages:
[email protected]:
resolution: {integrity: sha512-LcO7WnFu6lYSvCzZoo1dB+IO0xXz5uEv52HF1IUN0IqVTUIZGHuuR10I5efiLadGt+4oZqTcNZyVVEem/TM5nA==}
engines: {node: '>=18.17.0'}
deprecated: This version has a security vulnerability. Please upgrade to a patched version. See https://nextjs.org/blog/security-update-2025-12-11 for more details.
hasBin: true
peerDependencies:
'@opentelemetry/api': ^1.1.0
@@ -12645,6 +12655,7 @@ packages:
[email protected]:
resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==}
engines: {node: '>=10'}
deprecated: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
hasBin: true
[email protected]:
@@ -12825,7 +12836,7 @@ packages:
[email protected]:
resolution: {integrity: sha512-39olGaX2djYUdhaQQHDZ0T0GwEp+5f9UB9HmEP0qHfdQHIq0xGQZuAZ5TLnJIc/88SrPLpEflPC+xUqOTv3c5g==}
deprecated: < 22.8.2 is no longer supported
deprecated: < 24.15.0 is no longer supported
[email protected]:
resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==}
@@ -14104,10 +14115,12 @@ packages:
[email protected]:
resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==}
engines: {node: '>=4.5'}
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]
[email protected]:
resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}
engines: {node: '>=10'}
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]
[email protected]:
resolution: {integrity: sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==}
@@ -32304,6 +32317,13 @@ snapshots:
read-cache: 1.0.0
resolve: 1.22.10
[email protected]([email protected]):
dependencies:
postcss: 8.4.49
postcss-value-parser: 4.2.0
read-cache: 1.0.0
resolve: 1.22.10
[email protected]([email protected]):
dependencies:
camelcase-css: 2.0.1