Raxol.Payments.Assets.UsdcDomains (Raxol Payments v0.2.0)

Copy Markdown View Source

Per-chain USDC EIP-712 domain name and version values.

USDC's EIP-712 domain name is not uniform across chains: mainnet deployments report "USD Coin", but Ethereum/Base/OP Sepolia report "USDC". Signing with the wrong name produces a digest USDC's transferWithAuthorization will reject.

Values were verified on-chain via Blockscout. Source of truth for cross-checking: riddler-client/src/config.js (usdcName and usdcVersion per chain).

Example

iex> Raxol.Payments.Assets.UsdcDomains.lookup(8453)
%{name: "USD Coin", version: "2"}

iex> Raxol.Payments.Assets.UsdcDomains.lookup(11_155_111)
%{name: "USDC", version: "2"}

Summary

Functions

Return the set of chain IDs with explicit overrides.

Return %{name, version} for the given chain ID.

Functions

known_chain_ids()

@spec known_chain_ids() :: [pos_integer()]

Return the set of chain IDs with explicit overrides.

lookup(chain_id)

@spec lookup(pos_integer()) :: %{name: String.t(), version: String.t()}

Return %{name, version} for the given chain ID.

Falls back to %{name: "USD Coin", version: "2"} (the mainnet default) for unknown chain IDs so legacy callers continue to work.