MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getEIP712Domain

Function getEIP712Domain

src/services/x402/client.ts:113–132  ·  view source on GitHub ↗

* EIP-712 domain separator for EIP-3009 transferWithAuthorization. * * This follows the USDC contract's EIP-712 domain: * name: token name (e.g. "USD Coin") * version: token version (e.g. "2") * chainId: network chain ID * verifyingContract: USDC contract address

(requirement: PaymentRequirement)

Source from the content-addressed store, hash-verified

111 * verifyingContract: USDC contract address
112 */
113function getEIP712Domain(requirement: PaymentRequirement): {
114 name: string
115 version: string
116 chainId: number
117 verifyingContract: string
118} {
119 const chainIds: Record<PaymentNetwork, number> = {
120 'base': 8453,
121 'base-sepolia': 84532,
122 'ethereum': 1,
123 'ethereum-sepolia': 11155111,
124 }
125
126 return {
127 name: requirement.extra?.name ?? 'USD Coin',
128 version: requirement.extra?.version ?? '2',
129 chainId: chainIds[requirement.network],
130 verifyingContract: requirement.asset,
131 }
132}
133
134/**
135 * EIP-712 type hash for TransferWithAuthorization.

Callers 1

createPaymentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected