Skip to content

Commit b300680

Browse files
authored
Merge branch 'main' into ccip-tokens/update-202510122106
2 parents 5d90cdf + e5e6aaf commit b300680

File tree

9 files changed

+550
-58
lines changed

9 files changed

+550
-58
lines changed

jest.config.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
moduleNameMapper: {
1616
"\\.(css)$": "<rootDir>/src/__mocks__/styleMock.ts",
1717
"^~/(.*)$": "<rootDir>/src/$1",
18+
"^@api/(.*)$": "<rootDir>/src/pages/api/$1",
1819
"^@components": "<rootDir>/src/components/index.ts",
1920
"^@components/(.*)$": "<rootDir>/src/components/$1",
2021
"^@config$": "<rootDir>/src/config/index.ts",
@@ -27,6 +28,8 @@ module.exports = {
2728
"^@utils/(.*)$": "<rootDir>/src/utils/$1",
2829
"^@variables$": "<rootDir>/src/config/markdown-variables.ts",
2930
"^@abi$": "<rootDir>/src/features/abi/index.ts",
31+
"^@lib$": "<rootDir>/src/lib/index.ts",
32+
"^@lib/(.*)$": "<rootDir>/src/lib/$1",
3033
"\\.ya?ml$": "<rootDir>/src/__mocks__/yamlMock.ts",
3134
},
3235
transformIgnorePatterns: ["/node_modules/(?!.*\\.mjs$)"],

postman/ccip-chains-api.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,62 @@
160160
},
161161
"description": "Retrieve chains with response organized by internal ID"
162162
}
163+
},
164+
{
165+
"name": "Get Chain with Fee Tokens (Default - String Array)",
166+
"request": {
167+
"method": "GET",
168+
"url": {
169+
"raw": "{{baseUrl}}/api/ccip/v1/chains?environment=mainnet&chainId=1&enrichFeeTokens=false",
170+
"host": ["{{baseUrl}}"],
171+
"path": ["api", "ccip", "v1", "chains"],
172+
"query": [
173+
{
174+
"key": "environment",
175+
"value": "mainnet"
176+
},
177+
{
178+
"key": "chainId",
179+
"value": "1",
180+
"description": "Chain ID for Ethereum"
181+
},
182+
{
183+
"key": "enrichFeeTokens",
184+
"value": "false",
185+
"description": "Return fee tokens as string array (default behavior)"
186+
}
187+
]
188+
},
189+
"description": "Retrieve chain information with fee tokens returned as a simple string array (backward compatible format)"
190+
}
191+
},
192+
{
193+
"name": "Get Chain with Enriched Fee Tokens",
194+
"request": {
195+
"method": "GET",
196+
"url": {
197+
"raw": "{{baseUrl}}/api/ccip/v1/chains?environment=mainnet&chainId=1&enrichFeeTokens=true",
198+
"host": ["{{baseUrl}}"],
199+
"path": ["api", "ccip", "v1", "chains"],
200+
"query": [
201+
{
202+
"key": "environment",
203+
"value": "mainnet"
204+
},
205+
{
206+
"key": "chainId",
207+
"value": "1",
208+
"description": "Chain ID for Ethereum"
209+
},
210+
{
211+
"key": "enrichFeeTokens",
212+
"value": "true",
213+
"description": "Return detailed fee token information including addresses, names, and decimals"
214+
}
215+
]
216+
},
217+
"description": "Retrieve chain information with enriched fee token details including contract addresses, token names, and decimal places"
218+
}
163219
}
164220
]
165221
},

public/api/ccip/v1/openapi.json

Lines changed: 146 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"info": {
44
"title": "CCIP Docs config API",
55
"description": "API for retrieving CCIP chain, token, and lane information.\n\nTo get started quickly, you can download our [Postman Collection](/api/ccip/v1/postman-collection.json) which includes all endpoints and example requests.",
6-
"version": "1.4.0",
6+
"version": "1.5.0",
77
"contact": {
88
"name": "File issues",
99
"url": "https://github.com/smartcontractkit/documentation/issues/new/choose"
@@ -91,6 +91,16 @@
9191
"default": "chainId"
9292
},
9393
"description": "Key to use for organizing the response data"
94+
},
95+
{
96+
"name": "enrichFeeTokens",
97+
"in": "query",
98+
"schema": {
99+
"type": "string",
100+
"enum": ["true", "false"],
101+
"default": "false"
102+
},
103+
"description": "When set to 'true', returns detailed fee token information including addresses, names, and decimals instead of just symbol strings"
94104
}
95105
],
96106
"responses": {
@@ -101,47 +111,102 @@
101111
"schema": {
102112
"$ref": "#/components/schemas/ChainApiResponse"
103113
},
104-
"example": {
105-
"metadata": {
106-
"environment": "mainnet",
107-
"timestamp": "2024-03-14T12:00:00Z",
108-
"requestId": "123e4567-e89b-12d3-a456-426614174000",
109-
"ignoredChainCount": 0,
110-
"validChainCount": 2
111-
},
112-
"data": {
113-
"evm": {
114-
"1": {
115-
"chainId": 1,
116-
"displayName": "Ethereum",
117-
"selector": "5009297550715157269",
118-
"internalId": "ethereum-mainnet",
119-
"feeTokens": ["LINK", "WETH", "ETH"],
120-
"router": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D",
121-
"rmn": "0x411dE17f12D1A34ecC7F45f49844626267c75e81",
122-
"registryModule": "0x13022e3e6C77524308BD56AEd716E88311b2E533",
123-
"tokenAdminRegistry": "0xb22764f98dD05c789929716D677382Df22C05Cb6",
124-
"tokenPoolFactory": "0x17D8a409fE2ceF2d3808bcB61F14aBEFfc28876e",
125-
"chainType": "evm",
126-
"chainFamily": "evm"
127-
}
128-
},
129-
"svm": {
130-
"solana-devnet": {
131-
"chainId": "solana-devnet",
132-
"displayName": "Solana Devnet",
133-
"selector": "16015286601757825753",
134-
"internalId": "solana-devnet",
135-
"feeTokens": ["LINK", "SOL"],
136-
"router": "CCiPv7hcmEqNdMdJgmHDJmEJyCkBgLqxmcf87R1Gho6H",
137-
"rmn": "CRmNVnB7S6SqEPFG6m9dVp9fJJCjr3TC2TiAWB3RqNod",
138-
"feeQuoter": "FqbCVbS7a4ndxs9xZ8UmfL6LQsUhAJNkWxW3duJRrCWD",
139-
"chainType": "solana",
140-
"chainFamily": "svm"
141-
}
114+
"examples": {
115+
"default": {
116+
"summary": "Default response (string array for feeTokens)",
117+
"value": {
118+
"metadata": {
119+
"environment": "mainnet",
120+
"timestamp": "2024-03-14T12:00:00Z",
121+
"requestId": "123e4567-e89b-12d3-a456-426614174000",
122+
"ignoredChainCount": 0,
123+
"validChainCount": 2
124+
},
125+
"data": {
126+
"evm": {
127+
"1": {
128+
"chainId": 1,
129+
"displayName": "Ethereum",
130+
"selector": "5009297550715157269",
131+
"internalId": "ethereum-mainnet",
132+
"feeTokens": ["LINK", "WETH", "GHO"],
133+
"router": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D",
134+
"rmn": "0x411dE17f12D1A34ecC7F45f49844626267c75e81",
135+
"registryModule": "0x13022e3e6C77524308BD56AEd716E88311b2E533",
136+
"tokenAdminRegistry": "0xb22764f98dD05c789929716D677382Df22C05Cb6",
137+
"tokenPoolFactory": "0x17D8a409fE2ceF2d3808bcB61F14aBEFfc28876e",
138+
"chainType": "evm",
139+
"chainFamily": "evm"
140+
}
141+
},
142+
"svm": {
143+
"solana-devnet": {
144+
"chainId": "solana-devnet",
145+
"displayName": "Solana Devnet",
146+
"selector": "16015286601757825753",
147+
"internalId": "solana-devnet",
148+
"feeTokens": ["LINK", "SOL"],
149+
"router": "CCiPv7hcmEqNdMdJgmHDJmEJyCkBgLqxmcf87R1Gho6H",
150+
"rmn": "CRmNVnB7S6SqEPFG6m9dVp9fJJCjr3TC2TiAWB3RqNod",
151+
"feeQuoter": "FqbCVbS7a4ndxs9xZ8UmfL6LQsUhAJNkWxW3duJRrCWD",
152+
"chainType": "solana",
153+
"chainFamily": "svm"
154+
}
155+
}
156+
},
157+
"ignored": []
142158
}
143159
},
144-
"ignored": []
160+
"enriched": {
161+
"summary": "Enriched response (detailed objects for feeTokens when enrichFeeTokens=true)",
162+
"value": {
163+
"metadata": {
164+
"environment": "mainnet",
165+
"timestamp": "2024-03-14T12:00:00Z",
166+
"requestId": "123e4567-e89b-12d3-a456-426614174000",
167+
"ignoredChainCount": 0,
168+
"validChainCount": 1
169+
},
170+
"data": {
171+
"evm": {
172+
"1": {
173+
"chainId": 1,
174+
"displayName": "Ethereum",
175+
"selector": "5009297550715157269",
176+
"internalId": "ethereum-mainnet",
177+
"feeTokens": [
178+
{
179+
"symbol": "GHO",
180+
"name": "Gho Token",
181+
"address": "0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",
182+
"decimals": 18
183+
},
184+
{
185+
"symbol": "LINK",
186+
"name": "ChainLink Token",
187+
"address": "0x514910771AF9Ca656af840dff83E8264EcF986CA",
188+
"decimals": 18
189+
},
190+
{
191+
"symbol": "WETH",
192+
"name": "Wrapped Ether",
193+
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
194+
"decimals": 18
195+
}
196+
],
197+
"router": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D",
198+
"rmn": "0x411dE17f12D1A34ecC7F45f49844626267c75e81",
199+
"registryModule": "0x13022e3e6C77524308BD56AEd716E88311b2E533",
200+
"tokenAdminRegistry": "0xb22764f98dD05c789929716D677382Df22C05Cb6",
201+
"tokenPoolFactory": "0x17D8a409fE2ceF2d3808bcB61F14aBEFfc28876e",
202+
"chainType": "evm",
203+
"chainFamily": "evm"
204+
}
205+
}
206+
},
207+
"ignored": []
208+
}
209+
}
145210
}
146211
}
147212
}
@@ -514,6 +579,30 @@
514579
}
515580
}
516581
},
582+
"FeeTokenEnriched": {
583+
"type": "object",
584+
"required": ["symbol", "name", "address", "decimals"],
585+
"properties": {
586+
"symbol": {
587+
"type": "string",
588+
"description": "Token symbol (e.g., LINK, WETH)"
589+
},
590+
"name": {
591+
"type": "string",
592+
"description": "Token name (e.g., Chainlink, Wrapped Ether)"
593+
},
594+
"address": {
595+
"type": "string",
596+
"description": "Token contract address on this chain"
597+
},
598+
"decimals": {
599+
"type": "integer",
600+
"minimum": 0,
601+
"maximum": 18,
602+
"description": "Number of decimals for the token"
603+
}
604+
}
605+
},
517606
"ChainDetails": {
518607
"type": "object",
519608
"required": [
@@ -545,11 +634,23 @@
545634
"description": "Internal identifier for the chain"
546635
},
547636
"feeTokens": {
548-
"type": "array",
549-
"items": {
550-
"type": "string"
551-
},
552-
"description": "List of supported fee tokens"
637+
"oneOf": [
638+
{
639+
"type": "array",
640+
"items": {
641+
"type": "string"
642+
},
643+
"description": "List of supported fee token symbols (when enrichFeeTokens=false)"
644+
},
645+
{
646+
"type": "array",
647+
"items": {
648+
"$ref": "#/components/schemas/FeeTokenEnriched"
649+
},
650+
"description": "Detailed fee token information (when enrichFeeTokens=true)"
651+
}
652+
],
653+
"description": "Fee tokens - either as string symbols or enriched objects with addresses"
553654
},
554655
"router": {
555656
"type": "string",

public/api/ccip/v1/postman-collection.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,62 @@
321321
},
322322
"description": "Retrieve chain information for multiple chains using comma-separated selectors"
323323
}
324+
},
325+
{
326+
"name": "Get Chain with Fee Tokens (Default - String Array)",
327+
"request": {
328+
"method": "GET",
329+
"url": {
330+
"raw": "{{baseUrl}}/api/ccip/v1/chains?environment=mainnet&chainId=1&enrichFeeTokens=false",
331+
"host": ["{{baseUrl}}"],
332+
"path": ["api", "ccip", "v1", "chains"],
333+
"query": [
334+
{
335+
"key": "environment",
336+
"value": "mainnet"
337+
},
338+
{
339+
"key": "chainId",
340+
"value": "1",
341+
"description": "Chain ID for Ethereum"
342+
},
343+
{
344+
"key": "enrichFeeTokens",
345+
"value": "false",
346+
"description": "Return fee tokens as string array (default behavior)"
347+
}
348+
]
349+
},
350+
"description": "Retrieve chain information with fee tokens returned as a simple string array (backward compatible format)"
351+
}
352+
},
353+
{
354+
"name": "Get Chain with Enriched Fee Tokens",
355+
"request": {
356+
"method": "GET",
357+
"url": {
358+
"raw": "{{baseUrl}}/api/ccip/v1/chains?environment=mainnet&chainId=1&enrichFeeTokens=true",
359+
"host": ["{{baseUrl}}"],
360+
"path": ["api", "ccip", "v1", "chains"],
361+
"query": [
362+
{
363+
"key": "environment",
364+
"value": "mainnet"
365+
},
366+
{
367+
"key": "chainId",
368+
"value": "1",
369+
"description": "Chain ID for Ethereum"
370+
},
371+
{
372+
"key": "enrichFeeTokens",
373+
"value": "true",
374+
"description": "Return detailed fee token information including addresses, names, and decimals"
375+
}
376+
]
377+
},
378+
"description": "Retrieve chain information with enriched fee token details including contract addresses, token names, and decimal places"
379+
}
324380
}
325381
]
326382
},

src/pages/api/ccip/types/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ export type ChainFamily = "evm" | "mvm" | "svm"
1010

1111
export const prerender = false
1212

13+
/**
14+
* Enriched fee token information with address and metadata
15+
* Used when enrichFeeTokens=true query parameter is set
16+
*/
17+
export type FeeTokenEnriched = {
18+
symbol: string
19+
name: string
20+
address: string
21+
decimals: number
22+
}
23+
1324
export type ChainConfigError = {
1425
chainId: number
1526
networkId: string
@@ -29,7 +40,7 @@ export interface ChainDetails {
2940
displayName: string
3041
selector: string
3142
internalId: string
32-
feeTokens: string[]
43+
feeTokens: string[] | FeeTokenEnriched[]
3344
router: string
3445
rmn: string
3546
chainType: ChainType

0 commit comments

Comments
 (0)