Skip to content

refactor: move networkInfo and types to its own networks.ts file#255

Merged
andrevmatos merged 2 commits into
mainfrom
refactor/networkinfo
May 12, 2026
Merged

refactor: move networkInfo and types to its own networks.ts file#255
andrevmatos merged 2 commits into
mainfrom
refactor/networkinfo

Conversation

@andrevmatos
Copy link
Copy Markdown
Collaborator

Allowing it to be used standalone

@andrevmatos andrevmatos self-assigned this May 12, 2026
@andrevmatos andrevmatos requested review from a team, PabloMansanet and aelmanaa as code owners May 12, 2026 14:18
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ccip-tools-ts Ready Ready Preview, Comment May 12, 2026 2:24pm

Request Review

@github-actions
Copy link
Copy Markdown

👋 andrevmatos, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown

Coverage Report

ℹ tests 826
ℹ suites 238
ℹ pass 824
ℹ fail 0
ℹ cancelled 0
ℹ skipped 2
ℹ todo 0
ℹ duration_ms 144808.607725

> @chainlink/[email protected] test
> node --test

Verbose mode enabled
▶ getCtx
  ▶ output — always stdout
    ✔ output.write goes to stdout (1.866694ms)
    ✔ output.table goes to stdout (1.170553ms)
  ✔ output — always stdout (4.866922ms)
  ▶ logger — always stderr
    ✔ logger.info goes to stderr (0.683317ms)
    ✔ logger.warn goes to stderr (0.423587ms)
    ✔ logger.error goes to stderr (0.406395ms)
  ✔ logger — always stderr (1.776344ms)
  ▶ verbose mode
    ✔ logger.debug is a no-op when verbose is false (0.516302ms)
    ✔ logger.debug goes to stderr when verbose is true (2.135339ms)
  ✔ verbose mode (2.861136ms)
  ▶ destroy signal
    ✔ returns a working destroy function (13.055606ms)
    ✔ calling destroy twice does not throw (0.584781ms)
  ✔ destroy signal (14.076678ms)
✔ getCtx (24.70278ms)
▶ lane-latency command
  ✔ should output JSON format correctly (6.813666ms)
  ✔ should resolve chain IDs to chain selectors (3.025345ms)
  ✔ should use custom API URL when provided (0.686352ms)
  ✔ should output log format correctly (2.313363ms)
  ✔ should handle chain IDs as input (0.609378ms)
  ✔ should handle chain selectors as input (0.719965ms)
  ✔ should throw CCIPApiClientNotAvailableError when --no-api flag is set (2.30527ms)
  ✔ should work normally when --no-api flag is false (0.702452ms)
  ✔ should forward blockConfirmations to API URL (0.624646ms)
  ✔ should not include numOfBlocks when blockConfirmations is not provided (0.799335ms)
  ▶ CCIP_API environment variable integration
    ✔ should respect CCIP_API=false environment variable (0.643952ms)
  ✔ CCIP_API environment variable integration (0.835723ms)
✔ lane-latency command (21.574901ms)
▶ selectRequest non-interactive behavior
  ✔ returns the single request without prompting (1.050267ms)
  ✔ returns the request matching logIndex (0.222268ms)
  ✔ throws CCIPInteractiveRequiredError for multiple requests without logIndex (1.622544ms)
✔ selectRequest non-interactive behavior (4.254539ms)
▶ CCIPInteractiveRequiredError
  ✔ has correct code and is not transient (0.198293ms)
  ✔ uses default recovery when none provided (0.277092ms)
  ✔ preserves context fields (0.162736ms)
✔ CCIPInteractiveRequiredError (0.825964ms)
▶ preprocessArgv TTY auto-detection
  ✔ --interactive flag is defined in globalOpts (0.328859ms)
✔ preprocessArgv TTY auto-detection (0.493859ms)
▶ search messages command
  ✔ should throw CCIPApiClientNotAvailableError when --no-api flag is set (2.520204ms)
  ✔ should output JSON format correctly (16.460225ms)
  ✔ should pass sender filter to API (4.20768ms)
  ✔ should pass receiver filter to API (5.593386ms)
  ✔ should resolve source chain to selector (5.156399ms)
  ✔ should resolve dest chain to selector (4.236244ms)
  ✔ should pass manual-exec-only filter to API (3.769005ms)
  ✔ should treat limit 0 as unlimited (9.811666ms)
  ✔ should respect limit parameter (24.904771ms)
  ✔ should warn when no results found (2.76813ms)
  ✔ should use custom API URL when provided (5.069993ms)
  ✔ should warn on negative limit and fall back to default (5.080276ms)
  ✔ should output log format (2.251187ms)
✔ search messages command (101.419793ms)
▶ e2e command show EVM
  ▶ pretty format (default)
    ✔ should show complete CCIP transaction details EVM to EVM (10363.865826ms)
  ✔ pretty format (default) (10365.005321ms)
  ▶ json format
    ✔ should output a single valid JSON envelope with all expected fields (8369.432363ms)
  ✔ json format (8369.670161ms)
  ▶ log format
    ✔ should output in log format with object assignments (8418.660259ms)
  ✔ log format (8418.916662ms)
  ▶ verbose flag
    ✔ should work with verbose flag enabled (9100.389618ms)
  ✔ verbose flag (9100.616795ms)
  ▶ error handling
    ✔ should handle invalid transaction hash gracefully (9804.949959ms)
    ✔ should require transaction hash argument (1648.544359ms)
  ✔ error handling (11453.77685ms)
  ✔ should show complete CCIP transaction details EVM to Aptos (12365.556474ms)
  ✔ should show complete CCIP transaction details EVM to Solana (7244.426508ms)
✔ e2e command show EVM (67320.985529ms)
▶ e2e command show Solana
  ✔ should show complete CCIP transaction details Solana to EVM (9035.376223ms)
✔ e2e command show Solana (9035.623009ms)
▶ e2e command show Aptos
  ✔ should show complete CCIP transaction details Aptos to EVM (8331.2289ms)
✔ e2e command show Aptos (8331.417415ms)
﹣ e2e command show TON (0.057308ms) # SKIP
▶ formatCCIPError
  ✔ should return null for non-CCIPError instances (1.698046ms)
  ✔ should format CCIPError with code and message (0.599749ms)
  ✔ should include help section with recovery hint (0.373663ms)
  ✔ should include note section for transient errors (0.387199ms)
  ✔ should include retry timing for transient errors with retryAfterMs (0.346262ms)
  ✔ should not include note section for permanent errors (0.176532ms)
  ✔ should format error with structured output (0.282772ms)
  ✔ should include stack trace when verbose is true (0.400223ms)
  ✔ should not include stack trace when verbose is false (0.394804ms)
✔ formatCCIPError (6.946366ms)
▶ yieldResolved
  ✔ throws if a promise rejects while the generator is paused after a yield (19.305578ms)
✔ yieldResolved (19.502378ms)
▶ fetchChainsFromRpcs
  ✔ lets duplicate tx-hash race endpoints query before aborting losers (13.752688ms)
  ✔ chainGetter: returns chain from first winning endpoint and destroys late arrivals (51.401268ms)
  ✔ chainGetter: resolves a pending request once the endpoint connects (Branch 2) (20.594517ms)
  ✔ chainGetter: rejects with CCIPRpcNotFoundError when all endpoints fail to connect (1.458335ms)
  ✔ chainGetter: rejects immediately with CCIPRpcNotFoundError once family is already exhausted (0.620098ms)
  ✔ txHash: rejects with CCIPTransactionNotFoundError when tx not on any chain (0.959326ms)
  ✔ txHash: Branch-4 (txOnlyRacer) is destroyed via catch when it loses the tx race (10.161628ms)
  ✔ txHash: chain connecting after txFoundIn is set is immediately destroyed without calling getTransaction (24.630545ms)
  ✔ txHash: Branch-2 chain given to a pending chainGetter is NOT destroyed when it cannot find the tx (13.591405ms)
  ✔ txFoundIn shared across families: SVM txOnlyRacer is destroyed after EVM wins (34.029067ms)
✔ fetchChainsFromRpcs (173.028472ms)
ℹ tests 70
ℹ suites 23
ℹ pass 70
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 87087.103976
---------------------------------------|---------|----------|---------|---------|-------------------
File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------------------------------|---------|----------|---------|---------|-------------------
All files                              |   72.26 |    76.92 |   57.08 |   72.26 |                   
 ccip-cli/src                          |   89.71 |    61.53 |      75 |   89.71 |                   
  index.ts                             |   89.71 |    61.53 |      75 |   89.71 | ...60-161,167-172 
 ccip-cli/src/commands                 |   51.25 |    73.09 |   58.18 |   51.25 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  lane-latency.ts                      |   72.56 |     90.9 |   33.33 |   72.56 | ...,63-70,105-111 
  manual-exec.ts                       |   23.17 |      100 |       0 |   23.17 | ...28-138,140-300 
  parse.ts                             |   57.14 |      100 |       0 |   57.14 | 46-50,57-64,66-91 
  search.ts                            |   81.25 |      100 |       0 |   81.25 | 24-29             
  send.ts                              |   14.93 |      100 |       0 |   14.93 | ...89-220,222-462 
  show.ts                              |   76.71 |    61.97 |     100 |   76.71 | ...86-289,317-318 
  supported-tokens.ts                  |   16.95 |      100 |       0 |   16.95 | ...59-333,335-348 
  token.ts                             |   22.72 |      100 |       0 |   22.72 | ...3,60-67,69-132 
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   87.72 |    75.47 |   96.42 |   87.72 | ...02-612,620-628 
 ccip-cli/src/commands/search          |   49.19 |    82.85 |    12.5 |   49.19 |                   
  messages.ts                          |   49.19 |    82.85 |    12.5 |   49.19 | ...89-211,213-248 
 ccip-cli/src/providers                |   50.05 |    84.84 |   19.23 |   50.05 |                   
  aptos.ts                             |   51.47 |      100 |       0 |   51.47 | ...,95-96,105-136 
  evm.ts                               |    36.3 |      100 |       0 |    36.3 | ...69-104,116-168 
  index.ts                             |   80.23 |     83.6 |   83.33 |   80.23 | ...40-142,209-253 
  solana.ts                            |   47.44 |      100 |       0 |   47.44 | ...02-103,112-137 
  sui.ts                               |   64.28 |      100 |       0 |   64.28 | 10-14             
  ton.ts                               |   15.03 |      100 |       0 |   15.03 | 24-153            
 ccip-sdk/src                          |   95.27 |    81.21 |   92.47 |   95.27 |                   
  chain.ts                             |   94.07 |    75.82 |   69.56 |   94.07 | ...1812,1845-1846 
  commits.ts                           |     100 |    95.23 |     100 |     100 | 54                
  execution.ts                         |   92.19 |     92.3 |     100 |   92.19 | 130-137,149-156   
  explorer.ts                          |     100 |      100 |     100 |     100 |                   
  extra-args.ts                        |     100 |    89.47 |     100 |     100 | 213,248,285,300   
  gas.ts                               |   89.17 |    38.46 |     100 |   89.17 | ...70-174,189-190 
  http-status.ts                       |     100 |      100 |     100 |     100 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  messages.ts                          |   88.53 |    45.09 |     100 |   88.53 | ...30-231,255-256 
  networks.ts                          |     100 |      100 |     100 |     100 |                   
  offchain.ts                          |   94.16 |    79.54 |     100 |   94.16 | ...24-226,235-236 
  requests.ts                          |   95.61 |    82.67 |     100 |   95.61 | ...97,233,357-359 
  supported-chains.ts                  |     100 |      100 |     100 |     100 |                   
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   96.09 |    88.84 |     100 |   96.09 | ...03-804,811-819 
 ccip-sdk/src/api                      |   93.73 |       85 |   94.11 |   93.73 |                   
  index.ts                             |   93.73 |       85 |   94.11 |   93.73 | ...53-756,759-762 
 ccip-sdk/src/aptos                    |    56.6 |     67.4 |   56.66 |    56.6 |                   
  exec.ts                              |   29.31 |      100 |       0 |   29.31 | 18-58             
  hasher.ts                            |   76.52 |       80 |   66.66 |   76.52 | 20-39,53-59       
  index.ts                             |   55.74 |    73.23 |   58.13 |   55.74 | ...37-863,867-878 
  logs.ts                              |   88.67 |    55.76 |   85.71 |   88.67 | ...92,197,199-210 
  send.ts                              |    25.8 |      100 |       0 |    25.8 | ...2,63-80,93-124 
  token.ts                             |   23.75 |       75 |     100 |   23.75 | 35-156            
  types.ts                             |   65.97 |      100 |       0 |   65.97 | 26-33,65-89       
 ccip-sdk/src/canton                   |   33.29 |    63.63 |    4.81 |   33.29 |                   
  events.ts                            |   35.67 |      100 |       0 |   35.67 | ...71-383,389-398 
  index.ts                             |   29.32 |    55.55 |    5.71 |   29.32 | ...1799,1810-1814 
  types.ts                             |   84.42 |      100 |       0 |   84.42 | 18-25,112-122     
 ccip-sdk/src/canton/client            |   26.65 |      100 |       0 |   26.65 |                   
  client.ts                            |   23.12 |      100 |       0 |   23.12 | ...65-484,499-519 
  index.ts                             |     100 |      100 |     100 |     100 |                   
 ...dk/src/canton/explicit-disclosures |   69.45 |    70.83 |   35.29 |   69.45 |                   
  acs.ts                               |   82.87 |    70.21 |      80 |   82.87 | ...54-360,390-412 
  eds.ts                               |    54.7 |      100 |       0 |    54.7 | ...76-383,387-392 
 ccip-sdk/src/canton/token-metadata    |   62.64 |      100 |       0 |   62.64 |                   
  client.ts                            |   62.64 |      100 |       0 |   62.64 | 104-163,170-174   
 ...dk/src/canton/transfer-instruction |   52.15 |      100 |       0 |   52.15 |                   
  client.ts                            |   52.15 |      100 |       0 |   52.15 | 92-175,182-186    
 ccip-sdk/src/errors                   |   87.52 |    76.14 |    48.8 |   87.52 |                   
  CCIPError.ts                         |     100 |      100 |     100 |     100 |                   
  codes.ts                             |     100 |      100 |     100 |     100 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  pure.ts                              |     100 |       75 |     100 |     100 | 32                
  recovery.ts                          |     100 |      100 |     100 |     100 |                   
  specialized.ts                       |   84.64 |    71.25 |   45.76 |   84.64 | ...3345,3366-3375 
  utils.ts                             |   94.44 |    81.48 |     100 |   94.44 | 15,17,22,24       
 ccip-sdk/src/evm                      |   86.56 |    76.31 |   89.28 |   86.56 |                   
  const.ts                             |     100 |      100 |     100 |     100 |                   
  errors.ts                            |   92.76 |    82.41 |     100 |   92.76 | ...62,171-173,220 
  extra-args.ts                        |   94.47 |    61.01 |     100 |   94.47 | ...11-212,328-340 
  fork.test.data.ts                    |     100 |      100 |     100 |     100 |                   
  gas.ts                               |   97.97 |    53.33 |     100 |   97.97 | 72-73,75          
  hasher.ts                            |     100 |     92.3 |     100 |     100 | 135               
  index.ts                             |   80.15 |    76.57 |   89.06 |   80.15 | ...2125,2151-2159 
  logs.ts                              |    60.9 |    79.31 |   33.33 |    60.9 | ...2,62-63,98-132 
  messages.ts                          |     100 |      100 |     100 |     100 |                   
  offchain.ts                          |   81.25 |    33.33 |     100 |   81.25 | 11,13-14          
  types.ts                             |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/evm/viem                 |   79.76 |    90.62 |   69.23 |   79.76 |                   
  client-adapter.ts                    |     100 |       90 |     100 |     100 | 48,74             
  index.ts                             |     100 |      100 |     100 |     100 |                   
  wallet-adapter.ts                    |   63.09 |     90.9 |   55.55 |   63.09 | ...91-124,131-157 
 ccip-sdk/src/hasher                   |   94.29 |    78.94 |     100 |   94.29 |                   
  common.ts                            |     100 |      100 |     100 |     100 |                   
  hasher.ts                            |     100 |    66.66 |     100 |     100 | 19                
  index.ts                             |     100 |      100 |     100 |     100 |                   
  merklemulti.ts                       |   93.43 |       78 |     100 |   93.43 | ...06-307,315-316 
 ccip-sdk/src/shared                   |   88.05 |    69.23 |     100 |   88.05 |                   
  bcs-codecs.ts                        |   87.87 |    66.66 |     100 |   87.87 | 75-87,104-106     
  constants.ts                         |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/solana                   |   74.63 |    69.88 |   80.21 |   74.63 |                   
  cleanup.ts                           |   26.95 |    66.66 |   33.33 |   26.95 | ...59-101,114-227 
  exec.ts                              |   69.11 |    62.96 |   66.66 |   69.11 | ...69-473,513-514 
  fork.test.data.ts                    |     100 |      100 |     100 |     100 |                   
  gas.ts                               |   92.06 |    72.22 |     100 |   92.06 | ...,81-90,170-171 
  hasher.ts                            |   96.61 |    81.81 |     100 |   96.61 | 68-71             
  index.ts                             |   76.33 |    74.47 |   81.48 |   76.33 | ...1672,1676-1709 
  logs.ts                              |   69.35 |    58.62 |     100 |   69.35 | 51-52,54-55,61-94 
  offchain.ts                          |     100 |      100 |     100 |     100 |                   
  patchBorsh.ts                        |   78.31 |       50 |     100 |   78.31 | ...47,65-66,72-78 
  send.ts                              |    77.6 |    33.33 |      80 |    77.6 | ...52-360,403-442 
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   72.76 |    65.62 |   72.72 |   72.76 | ...43-445,477-492 
 ccip-sdk/src/sui                      |   34.88 |    86.66 |   19.29 |   34.88 |                   
  discovery.ts                         |   14.86 |      100 |       0 |   14.86 | ...49-185,188-222 
  events.ts                            |   30.94 |       50 |      25 |   30.94 | ...18-283,305-306 
  exec.ts                              |   31.81 |      100 |       0 |   31.81 | 32-75,87-132      
  hasher.ts                            |   98.16 |    66.66 |     100 |   98.16 | 33,49             
  index.ts                             |   39.91 |    93.18 |   17.94 |   39.91 | ...24-825,829-830 
  objects.ts                           |   18.93 |      100 |       0 |   18.93 | ...33-184,195-338 
 ccip-sdk/src/sui/manuallyExec         |   54.12 |       75 |      50 |   54.12 |                   
  encoder.ts                           |    83.9 |    66.66 |     100 |    83.9 | 51-58,73-77,82    
  index.ts                             |   34.35 |      100 |       0 |   34.35 | 46-131            
 ccip-sdk/src/ton                      |   77.12 |    79.53 |    73.8 |   77.12 |                   
  exec.ts                              |     100 |      100 |     100 |     100 |                   
  extra-args.ts                        |   98.66 |    72.72 |     100 |   98.66 | 156-157,222       
  hasher.ts                            |   78.07 |    77.77 |      75 |   78.07 | 100-108,156-187   
  index.ts                             |   71.29 |    76.66 |   56.52 |   71.29 | ...1231,1238-1239 
  logs.ts                              |     100 |    95.55 |     100 |     100 | 66-71             
  send.ts                              |   95.93 |       70 |     100 |   95.93 | 37-44             
  types.ts                             |   91.24 |    81.25 |     100 |   91.24 | ...61-63,71-74,92 
  utils.ts                             |    63.1 |    78.18 |    90.9 |    63.1 | ...37-395,397-400 
---------------------------------------|---------|----------|---------|---------|-------------------

@andrevmatos andrevmatos enabled auto-merge (squash) May 12, 2026 14:32
@andrevmatos andrevmatos merged commit f982277 into main May 12, 2026
13 checks passed
@andrevmatos andrevmatos deleted the refactor/networkinfo branch May 12, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants