Skip to content

ABI gateway URL should be configurable #854

Description

@cen1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions