safe-react-apps icon indicating copy to clipboard operation
safe-react-apps copied to clipboard

ABI gateway URL should be configurable

Open cen1 opened this issue 7 months ago • 0 comments

Description

In this line: https://github.com/safe-global/safe-react-apps/blob/development/apps/tx-builder/src/lib/getAbi.ts#L23

The URL to gateway is hardcoded. For custom/local deployments, this URL should point to the local CGW instance not to the global URL. Therefore, the CGW URL should be configurable at build and/or runtime.

I attempted to fix this myself with

const DEFAULT_GATEWAY_URL = 'https://safe-client.safe.global'
const GATEWAY_BASE_URL = process.env.CGW_URL || DEFAULT_GATEWAY_URL
...
return `${GATEWAY_BASE_URL}/v1/chains/${chain}/contracts/${address}`

but due to my limited react knowledge I was unable to get it to pick up the env, either at build or run time.

Environment

  • Browser: any
  • Wallet: any
  • Environment: self-hosted deployment

cen1 avatar Jun 04 '25 11:06 cen1