uvd-x402-sdk 0.2.2__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uvd_x402_sdk/__init__.py +185 -169
- uvd_x402_sdk/client.py +527 -527
- uvd_x402_sdk/config.py +248 -248
- uvd_x402_sdk/decorators.py +325 -325
- uvd_x402_sdk/exceptions.py +254 -254
- uvd_x402_sdk/integrations/__init__.py +74 -74
- uvd_x402_sdk/integrations/django_integration.py +237 -237
- uvd_x402_sdk/integrations/fastapi_integration.py +330 -330
- uvd_x402_sdk/integrations/flask_integration.py +259 -259
- uvd_x402_sdk/integrations/lambda_integration.py +320 -320
- uvd_x402_sdk/models.py +397 -397
- uvd_x402_sdk/networks/__init__.py +80 -54
- uvd_x402_sdk/networks/base.py +498 -347
- uvd_x402_sdk/networks/evm.py +356 -215
- uvd_x402_sdk/networks/near.py +397 -397
- uvd_x402_sdk/networks/solana.py +282 -282
- uvd_x402_sdk/networks/stellar.py +129 -129
- uvd_x402_sdk/response.py +439 -439
- {uvd_x402_sdk-0.2.2.dist-info → uvd_x402_sdk-0.3.0.dist-info}/LICENSE +21 -21
- {uvd_x402_sdk-0.2.2.dist-info → uvd_x402_sdk-0.3.0.dist-info}/METADATA +927 -778
- uvd_x402_sdk-0.3.0.dist-info/RECORD +23 -0
- uvd_x402_sdk-0.2.2.dist-info/RECORD +0 -23
- {uvd_x402_sdk-0.2.2.dist-info → uvd_x402_sdk-0.3.0.dist-info}/WHEEL +0 -0
- {uvd_x402_sdk-0.2.2.dist-info → uvd_x402_sdk-0.3.0.dist-info}/top_level.txt +0 -0
uvd_x402_sdk/networks/evm.py
CHANGED
|
@@ -1,215 +1,356 @@
|
|
|
1
|
-
"""
|
|
2
|
-
EVM network configurations.
|
|
3
|
-
|
|
4
|
-
This module defines configurations for all supported EVM-compatible chains.
|
|
5
|
-
Each chain uses ERC-3009 TransferWithAuthorization for USDC transfers.
|
|
6
|
-
|
|
7
|
-
Important EIP-712 domain considerations:
|
|
8
|
-
- Most chains use 'USD Coin' as the domain name
|
|
9
|
-
- Celo, HyperEVM, Unichain, Monad use 'USDC' as the domain name
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
""
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
1
|
+
"""
|
|
2
|
+
EVM network configurations.
|
|
3
|
+
|
|
4
|
+
This module defines configurations for all supported EVM-compatible chains.
|
|
5
|
+
Each chain uses ERC-3009 TransferWithAuthorization for USDC transfers.
|
|
6
|
+
|
|
7
|
+
Important EIP-712 domain considerations:
|
|
8
|
+
- Most chains use 'USD Coin' as the domain name
|
|
9
|
+
- Celo, HyperEVM, Unichain, Monad use 'USDC' as the domain name
|
|
10
|
+
|
|
11
|
+
Multi-token support:
|
|
12
|
+
- USDC: All chains (6 decimals)
|
|
13
|
+
- EURC: Ethereum, Base, Avalanche (6 decimals)
|
|
14
|
+
- AUSD: Ethereum, Arbitrum, Avalanche, Polygon, Monad (6 decimals)
|
|
15
|
+
- PYUSD: Ethereum (6 decimals)
|
|
16
|
+
- GHO: Ethereum, Base, Arbitrum (18 decimals)
|
|
17
|
+
- crvUSD: Ethereum, Arbitrum (18 decimals)
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from uvd_x402_sdk.networks.base import (
|
|
21
|
+
NetworkConfig,
|
|
22
|
+
NetworkType,
|
|
23
|
+
TokenConfig,
|
|
24
|
+
register_network,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# =============================================================================
|
|
28
|
+
# EVM Networks Configuration
|
|
29
|
+
# =============================================================================
|
|
30
|
+
|
|
31
|
+
# Base (Layer 2) - supports USDC, EURC, GHO
|
|
32
|
+
BASE = NetworkConfig(
|
|
33
|
+
name="base",
|
|
34
|
+
display_name="Base",
|
|
35
|
+
network_type=NetworkType.EVM,
|
|
36
|
+
chain_id=8453,
|
|
37
|
+
usdc_address="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
38
|
+
usdc_decimals=6,
|
|
39
|
+
usdc_domain_name="USD Coin",
|
|
40
|
+
usdc_domain_version="2",
|
|
41
|
+
rpc_url="https://mainnet.base.org",
|
|
42
|
+
enabled=True,
|
|
43
|
+
tokens={
|
|
44
|
+
"usdc": TokenConfig(
|
|
45
|
+
address="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
46
|
+
decimals=6,
|
|
47
|
+
name="USD Coin",
|
|
48
|
+
version="2",
|
|
49
|
+
),
|
|
50
|
+
"eurc": TokenConfig(
|
|
51
|
+
address="0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",
|
|
52
|
+
decimals=6,
|
|
53
|
+
name="EURC",
|
|
54
|
+
version="2",
|
|
55
|
+
),
|
|
56
|
+
"gho": TokenConfig(
|
|
57
|
+
address="0x6Bb7a212910682DCFdbd5BCBb3e28FB4E8da10Ee",
|
|
58
|
+
decimals=18,
|
|
59
|
+
name="Gho Token",
|
|
60
|
+
version="1",
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Ethereum Mainnet (supports all 6 stablecoins)
|
|
66
|
+
ETHEREUM = NetworkConfig(
|
|
67
|
+
name="ethereum",
|
|
68
|
+
display_name="Ethereum",
|
|
69
|
+
network_type=NetworkType.EVM,
|
|
70
|
+
chain_id=1,
|
|
71
|
+
usdc_address="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
72
|
+
usdc_decimals=6,
|
|
73
|
+
usdc_domain_name="USD Coin",
|
|
74
|
+
usdc_domain_version="2",
|
|
75
|
+
rpc_url="https://eth.llamarpc.com",
|
|
76
|
+
enabled=True,
|
|
77
|
+
tokens={
|
|
78
|
+
"usdc": TokenConfig(
|
|
79
|
+
address="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
80
|
+
decimals=6,
|
|
81
|
+
name="USD Coin",
|
|
82
|
+
version="2",
|
|
83
|
+
),
|
|
84
|
+
"eurc": TokenConfig(
|
|
85
|
+
address="0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
|
|
86
|
+
decimals=6,
|
|
87
|
+
name="EURC",
|
|
88
|
+
version="2",
|
|
89
|
+
),
|
|
90
|
+
"ausd": TokenConfig(
|
|
91
|
+
address="0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
|
|
92
|
+
decimals=6,
|
|
93
|
+
name="Agora USD",
|
|
94
|
+
version="1",
|
|
95
|
+
),
|
|
96
|
+
"pyusd": TokenConfig(
|
|
97
|
+
address="0x6c3ea9036406852006290770BEdFcAbA0e23A0e8",
|
|
98
|
+
decimals=6,
|
|
99
|
+
name="PayPal USD",
|
|
100
|
+
version="1",
|
|
101
|
+
),
|
|
102
|
+
"gho": TokenConfig(
|
|
103
|
+
address="0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",
|
|
104
|
+
decimals=18,
|
|
105
|
+
name="Gho Token",
|
|
106
|
+
version="1",
|
|
107
|
+
),
|
|
108
|
+
"crvusd": TokenConfig(
|
|
109
|
+
address="0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E",
|
|
110
|
+
decimals=18,
|
|
111
|
+
name="Curve.Fi USD Stablecoin",
|
|
112
|
+
version="1",
|
|
113
|
+
),
|
|
114
|
+
},
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
# Polygon (PoS) - supports USDC, AUSD
|
|
118
|
+
POLYGON = NetworkConfig(
|
|
119
|
+
name="polygon",
|
|
120
|
+
display_name="Polygon",
|
|
121
|
+
network_type=NetworkType.EVM,
|
|
122
|
+
chain_id=137,
|
|
123
|
+
usdc_address="0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
|
|
124
|
+
usdc_decimals=6,
|
|
125
|
+
usdc_domain_name="USD Coin",
|
|
126
|
+
usdc_domain_version="2",
|
|
127
|
+
rpc_url="https://polygon-rpc.com",
|
|
128
|
+
enabled=True,
|
|
129
|
+
tokens={
|
|
130
|
+
"usdc": TokenConfig(
|
|
131
|
+
address="0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
|
|
132
|
+
decimals=6,
|
|
133
|
+
name="USD Coin",
|
|
134
|
+
version="2",
|
|
135
|
+
),
|
|
136
|
+
"ausd": TokenConfig(
|
|
137
|
+
address="0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
|
|
138
|
+
decimals=6,
|
|
139
|
+
name="Agora USD",
|
|
140
|
+
version="1",
|
|
141
|
+
),
|
|
142
|
+
},
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
# Arbitrum One - supports USDC, AUSD, GHO, crvUSD
|
|
146
|
+
ARBITRUM = NetworkConfig(
|
|
147
|
+
name="arbitrum",
|
|
148
|
+
display_name="Arbitrum One",
|
|
149
|
+
network_type=NetworkType.EVM,
|
|
150
|
+
chain_id=42161,
|
|
151
|
+
usdc_address="0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
152
|
+
usdc_decimals=6,
|
|
153
|
+
usdc_domain_name="USD Coin",
|
|
154
|
+
usdc_domain_version="2",
|
|
155
|
+
rpc_url="https://arb1.arbitrum.io/rpc",
|
|
156
|
+
enabled=True,
|
|
157
|
+
tokens={
|
|
158
|
+
"usdc": TokenConfig(
|
|
159
|
+
address="0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
160
|
+
decimals=6,
|
|
161
|
+
name="USD Coin",
|
|
162
|
+
version="2",
|
|
163
|
+
),
|
|
164
|
+
"ausd": TokenConfig(
|
|
165
|
+
address="0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
|
|
166
|
+
decimals=6,
|
|
167
|
+
name="Agora USD",
|
|
168
|
+
version="1",
|
|
169
|
+
),
|
|
170
|
+
"gho": TokenConfig(
|
|
171
|
+
address="0x7dfF72693f6A4149b17e7C6314655f6A9F7c8B33",
|
|
172
|
+
decimals=18,
|
|
173
|
+
name="Gho Token",
|
|
174
|
+
version="1",
|
|
175
|
+
),
|
|
176
|
+
"crvusd": TokenConfig(
|
|
177
|
+
address="0x498Bf2B1e120FeD3ad3D42EA2165E9b73f99C1e5",
|
|
178
|
+
decimals=18,
|
|
179
|
+
name="Curve.Fi USD Stablecoin",
|
|
180
|
+
version="1",
|
|
181
|
+
),
|
|
182
|
+
},
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
# Optimism
|
|
186
|
+
OPTIMISM = NetworkConfig(
|
|
187
|
+
name="optimism",
|
|
188
|
+
display_name="Optimism",
|
|
189
|
+
network_type=NetworkType.EVM,
|
|
190
|
+
chain_id=10,
|
|
191
|
+
usdc_address="0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
192
|
+
usdc_decimals=6,
|
|
193
|
+
usdc_domain_name="USD Coin",
|
|
194
|
+
usdc_domain_version="2",
|
|
195
|
+
rpc_url="https://mainnet.optimism.io",
|
|
196
|
+
enabled=True,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
# Avalanche C-Chain - supports USDC, EURC, AUSD
|
|
200
|
+
AVALANCHE = NetworkConfig(
|
|
201
|
+
name="avalanche",
|
|
202
|
+
display_name="Avalanche C-Chain",
|
|
203
|
+
network_type=NetworkType.EVM,
|
|
204
|
+
chain_id=43114,
|
|
205
|
+
usdc_address="0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
|
|
206
|
+
usdc_decimals=6,
|
|
207
|
+
usdc_domain_name="USD Coin",
|
|
208
|
+
usdc_domain_version="2",
|
|
209
|
+
rpc_url="https://avalanche-c-chain-rpc.publicnode.com",
|
|
210
|
+
enabled=True,
|
|
211
|
+
tokens={
|
|
212
|
+
"usdc": TokenConfig(
|
|
213
|
+
address="0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
|
|
214
|
+
decimals=6,
|
|
215
|
+
name="USD Coin",
|
|
216
|
+
version="2",
|
|
217
|
+
),
|
|
218
|
+
"eurc": TokenConfig(
|
|
219
|
+
address="0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",
|
|
220
|
+
decimals=6,
|
|
221
|
+
name="EURC",
|
|
222
|
+
version="2",
|
|
223
|
+
),
|
|
224
|
+
"ausd": TokenConfig(
|
|
225
|
+
address="0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
|
|
226
|
+
decimals=6,
|
|
227
|
+
name="Agora USD",
|
|
228
|
+
version="1",
|
|
229
|
+
),
|
|
230
|
+
},
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
# Celo
|
|
234
|
+
# NOTE: Celo uses 'USDC' (not 'USD Coin') for EIP-712 domain name
|
|
235
|
+
CELO = NetworkConfig(
|
|
236
|
+
name="celo",
|
|
237
|
+
display_name="Celo",
|
|
238
|
+
network_type=NetworkType.EVM,
|
|
239
|
+
chain_id=42220,
|
|
240
|
+
usdc_address="0xcebA9300f2b948710d2653dD7B07f33A8B32118C",
|
|
241
|
+
usdc_decimals=6,
|
|
242
|
+
usdc_domain_name="USDC", # Different from other chains!
|
|
243
|
+
usdc_domain_version="2",
|
|
244
|
+
rpc_url="https://forno.celo.org",
|
|
245
|
+
enabled=True,
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
# HyperEVM (Hyperliquid)
|
|
249
|
+
# NOTE: HyperEVM uses 'USDC' (not 'USD Coin') for EIP-712 domain name
|
|
250
|
+
HYPEREVM = NetworkConfig(
|
|
251
|
+
name="hyperevm",
|
|
252
|
+
display_name="HyperEVM",
|
|
253
|
+
network_type=NetworkType.EVM,
|
|
254
|
+
chain_id=999,
|
|
255
|
+
usdc_address="0xb88339CB7199b77E23DB6E890353E22632Ba630f",
|
|
256
|
+
usdc_decimals=6,
|
|
257
|
+
usdc_domain_name="USDC", # Different from other chains!
|
|
258
|
+
usdc_domain_version="2",
|
|
259
|
+
rpc_url="https://rpc.hyperliquid.xyz/evm",
|
|
260
|
+
enabled=True,
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
# Unichain
|
|
264
|
+
# NOTE: Unichain uses 'USDC' (not 'USD Coin') for EIP-712 domain name
|
|
265
|
+
UNICHAIN = NetworkConfig(
|
|
266
|
+
name="unichain",
|
|
267
|
+
display_name="Unichain",
|
|
268
|
+
network_type=NetworkType.EVM,
|
|
269
|
+
chain_id=130,
|
|
270
|
+
usdc_address="0x078d782b760474a361dda0af3839290b0ef57ad6",
|
|
271
|
+
usdc_decimals=6,
|
|
272
|
+
usdc_domain_name="USDC", # Different from other chains!
|
|
273
|
+
usdc_domain_version="2",
|
|
274
|
+
rpc_url="https://unichain-rpc.publicnode.com",
|
|
275
|
+
enabled=True,
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
# Monad - supports USDC, AUSD
|
|
279
|
+
# NOTE: Monad uses 'USDC' (not 'USD Coin') for EIP-712 domain name
|
|
280
|
+
MONAD = NetworkConfig(
|
|
281
|
+
name="monad",
|
|
282
|
+
display_name="Monad",
|
|
283
|
+
network_type=NetworkType.EVM,
|
|
284
|
+
chain_id=143,
|
|
285
|
+
usdc_address="0x754704bc059f8c67012fed69bc8a327a5aafb603",
|
|
286
|
+
usdc_decimals=6,
|
|
287
|
+
usdc_domain_name="USDC", # Different from other chains!
|
|
288
|
+
usdc_domain_version="2",
|
|
289
|
+
rpc_url="https://rpc.monad.xyz",
|
|
290
|
+
enabled=True,
|
|
291
|
+
tokens={
|
|
292
|
+
"usdc": TokenConfig(
|
|
293
|
+
address="0x754704bc059f8c67012fed69bc8a327a5aafb603",
|
|
294
|
+
decimals=6,
|
|
295
|
+
name="USDC",
|
|
296
|
+
version="2",
|
|
297
|
+
),
|
|
298
|
+
"ausd": TokenConfig(
|
|
299
|
+
address="0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
|
|
300
|
+
decimals=6,
|
|
301
|
+
name="Agora USD",
|
|
302
|
+
version="1",
|
|
303
|
+
),
|
|
304
|
+
},
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
# =============================================================================
|
|
308
|
+
# Register all EVM networks
|
|
309
|
+
# =============================================================================
|
|
310
|
+
|
|
311
|
+
_EVM_NETWORKS = [
|
|
312
|
+
BASE,
|
|
313
|
+
ETHEREUM,
|
|
314
|
+
POLYGON,
|
|
315
|
+
ARBITRUM,
|
|
316
|
+
OPTIMISM,
|
|
317
|
+
AVALANCHE,
|
|
318
|
+
CELO,
|
|
319
|
+
HYPEREVM,
|
|
320
|
+
UNICHAIN,
|
|
321
|
+
MONAD,
|
|
322
|
+
]
|
|
323
|
+
|
|
324
|
+
for network in _EVM_NETWORKS:
|
|
325
|
+
register_network(network)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
def get_usdc_domain_name(network_name: str) -> str:
|
|
329
|
+
"""
|
|
330
|
+
Get the correct EIP-712 domain name for USDC on a network.
|
|
331
|
+
|
|
332
|
+
Args:
|
|
333
|
+
network_name: Network identifier
|
|
334
|
+
|
|
335
|
+
Returns:
|
|
336
|
+
Domain name string ('USD Coin' or 'USDC')
|
|
337
|
+
"""
|
|
338
|
+
# Networks that use 'USDC' instead of 'USD Coin'
|
|
339
|
+
usdc_domain_networks = {"celo", "hyperevm", "unichain", "monad"}
|
|
340
|
+
|
|
341
|
+
if network_name.lower() in usdc_domain_networks:
|
|
342
|
+
return "USDC"
|
|
343
|
+
return "USD Coin"
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def get_token_decimals(network_name: str) -> int:
|
|
347
|
+
"""
|
|
348
|
+
Get USDC token decimals for a network.
|
|
349
|
+
|
|
350
|
+
Args:
|
|
351
|
+
network_name: Network identifier
|
|
352
|
+
|
|
353
|
+
Returns:
|
|
354
|
+
Number of decimals (6 for all supported chains)
|
|
355
|
+
"""
|
|
356
|
+
return 6
|