Skip to content

cli: show messageId#142

Open
andrevmatos wants to merge 2 commits intomainfrom
cli/msgid
Open

cli: show messageId#142
andrevmatos wants to merge 2 commits intomainfrom
cli/msgid

Conversation

@andrevmatos
Copy link
Collaborator

@andrevmatos andrevmatos commented Feb 16, 2026

  • API.fromUrl becomes non-async, returns memoized client instance (for deduplication)
  • Used in show to race getMessageById in parallel with Chain.getTransactions
  • Improves prettyTable output
  • Can print v2 messages (at least what comes from API)

Race Chain.getTransactions and API.getMessageById, and print however it
can
@andrevmatos andrevmatos self-assigned this Feb 16, 2026
@andrevmatos andrevmatos requested a review from a team as a code owner February 16, 2026 20:57
@vercel
Copy link

vercel bot commented Feb 16, 2026

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

Project Deployment Actions Updated (UTC)
ccip-tools-ts Error Error Feb 16, 2026 8:57pm

Request Review

@github-actions
Copy link

👋 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

Coverage Report

ℹ tests 702
ℹ suites 216
ℹ pass 702
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 59691.504545
-------------------------------|---------|----------|---------|---------|---------------------------
File                           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s         
-------------------------------|---------|----------|---------|---------|---------------------------
All files                      |   68.37 |    78.44 |   57.07 |   68.37 |                           
 ccip-cli/src                  |   86.45 |    83.33 |      50 |   86.45 |                           
  index.ts                     |   86.45 |    83.33 |      50 |   86.45 | 72-76,82-83,88-93         
 ccip-cli/src/commands         |    51.8 |       74 |    54.9 |    51.8 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  lane-latency.ts              |   67.74 |     87.5 |   33.33 |   67.74 | 23-37,44-51,85-91         
  manual-exec.ts               |   19.73 |      100 |       0 |   19.73 | 37-101,108-118,120-226    
  parse.ts                     |   46.57 |      100 |       0 |   46.57 | 28-32,39-46,48-73         
  send.ts                      |   11.04 |      100 |       0 |   11.04 | 31-132,139-146,148-335    
  show.ts                      |   91.34 |       66 |      60 |   91.34 | ...23-129,135-137,146-147 
  supported-tokens.ts          |   21.72 |      100 |       0 |   21.72 | ...99-195,197-252,254-267 
  token.ts                     |   22.72 |      100 |       0 |   22.72 | 24-53,60-67,69-132        
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   86.66 |    74.81 |    92.3 |   86.66 | ...54-564,572-580,590-596 
 ccip-cli/src/providers        |   53.63 |       75 |   17.39 |   53.63 |                           
  aptos.ts                     |   53.65 |      100 |       0 |   53.65 | ...70,78-85,91-92,101-123 
  evm.ts                       |   46.03 |      100 |       0 |   46.03 | 20,31-63                  
  index.ts                     |   81.49 |    72.09 |      80 |   81.49 | 49-50,188-227             
  solana.ts                    |   50.42 |      100 |       0 |   50.42 | ...-71,79-85,89-90,99-117 
  sui.ts                       |   64.28 |      100 |       0 |   64.28 | 10-14                     
  ton.ts                       |   14.58 |      100 |       0 |   14.58 | 22-144                    
 ccip-sdk/src                  |   94.45 |    87.65 |   92.42 |   94.45 |                           
  chain.ts                     |   92.29 |       80 |   69.23 |   92.29 | ...7-526,805,872,998-1008 
  commits.ts                   |     100 |    88.88 |     100 |     100 | 35,52                     
  execution.ts                 |   86.74 |      100 |      75 |   86.74 | 145-166                   
  explorer.ts                  |     100 |      100 |     100 |     100 |                           
  extra-args.ts                |     100 |    85.71 |     100 |     100 | 164,194                   
  gas.ts                       |   88.09 |       50 |     100 |   88.09 | 76-85,107-111             
  http-status.ts               |     100 |      100 |     100 |     100 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  offchain.ts                  |     100 |      100 |     100 |     100 |                           
  requests.ts                  |   90.82 |       84 |     100 |   90.82 | ...05-309,358-359,363-364 
  supported-chains.ts          |     100 |      100 |     100 |     100 |                           
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   95.06 |    90.04 |     100 |   95.06 | ...07,671-672,688,753-761 
 ccip-sdk/src/api              |   96.86 |    80.32 |    92.3 |   96.86 |                           
  index.ts                     |   96.86 |    80.32 |    92.3 |   96.86 | ...32-233,313-314,378-379 
 ccip-sdk/src/aptos            |   56.86 |    71.11 |   58.06 |   56.86 |                           
  exec.ts                      |   29.31 |      100 |       0 |   29.31 | 18-58                     
  hasher.ts                    |   76.31 |       80 |   66.66 |   76.31 | 19-38,52-58               
  index.ts                     |   58.76 |    77.63 |   61.36 |   58.76 | ...82-717,721-823,827-838 
  logs.ts                      |   78.52 |    57.44 |      75 |   78.52 | ...90-196,200-233,264-268 
  send.ts                      |    25.2 |      100 |       0 |    25.2 | 10-51,62-79,92-123        
  token.ts                     |   23.75 |       75 |     100 |   23.75 | 35-156                    
  types.ts                     |   65.62 |      100 |       0 |   65.62 | 25-32,64-88               
 ccip-sdk/src/errors           |   79.57 |    77.07 |   47.89 |   79.57 |                           
  CCIPError.ts                 |     100 |      100 |     100 |     100 |                           
  codes.ts                     |     100 |      100 |     100 |     100 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  recovery.ts                  |     100 |      100 |     100 |     100 |                           
  specialized.ts               |   71.56 |    72.66 |   45.13 |   71.56 | ...36,1744-1753,1761-1770 
  utils.ts                     |   94.52 |    78.57 |     100 |   94.52 | 16,18,23,25               
 ccip-sdk/src/evm              |   78.06 |    75.29 |   75.64 |   78.06 |                           
  const.ts                     |     100 |      100 |     100 |     100 |                           
  errors.ts                    |   86.17 |    79.71 |     100 |   86.17 | ...12-113,155-157,198-216 
  extra-args.ts                |    94.7 |    66.66 |     100 |    94.7 | ...00-201,226-227,344-356 
  gas.ts                       |      98 |    53.84 |     100 |      98 | 72-73,75                  
  hasher.ts                    |     100 |    72.72 |     100 |     100 | 108,134,164               
  index.ts                     |   74.11 |    81.64 |   72.22 |   74.11 | ...94,1401-1450,1487-1494 
  logs.ts                      |   33.99 |     62.5 |      25 |   33.99 | ...13-214,229-258,274-302 
  messages.ts                  |     100 |      100 |     100 |     100 |                           
  offchain.ts                  |   80.97 |    53.33 |      75 |   80.97 | ...51-153,157-171,197-202 
 ccip-sdk/src/evm/viem         |   77.72 |       92 |   69.23 |   77.72 |                           
  client-adapter.ts            |     100 |     92.3 |     100 |     100 | 48                        
  index.ts                     |     100 |      100 |     100 |     100 |                           
  wallet-adapter.ts            |   63.09 |     90.9 |   55.55 |   63.09 | ...6,53-73,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 | ...59-260,306-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           |   53.34 |    68.91 |   56.32 |   53.34 |                           
  cleanup.ts                   |   12.22 |      100 |       0 |   12.22 | 29-229                    
  exec.ts                      |    9.43 |      100 |       0 |    9.43 | ...68-343,345-384,386-498 
  hasher.ts                    |   96.58 |    81.81 |     100 |   96.58 | 67-70                     
  index.ts                     |   72.46 |    74.27 |   66.03 |   72.46 | ...89,1493-1517,1521-1542 
  logs.ts                      |   74.19 |    27.27 |     100 |   74.19 | ...,50-51,53-54,56-88,119 
  offchain.ts                  |   78.87 |     64.7 |      50 |   78.87 | ...,96-97,110-111,126-142 
  patchBorsh.ts                |   65.06 |    57.14 |      75 |   65.06 | 30-49,65-66,72-78         
  send.ts                      |   13.93 |      100 |       0 |   13.93 | ...57-246,259-325,327-366 
  types.ts                     |   74.46 |      100 |       0 |   74.46 | 36-47                     
  utils.ts                     |   54.62 |    77.77 |   54.54 |   54.62 | ...37-350,392-455,461-476 
 ccip-sdk/src/sui              |   31.63 |    88.88 |   17.24 |   31.63 |                           
  discovery.ts                 |   15.13 |      100 |       0 |   15.13 | 20-36,49-185,188-218      
  events.ts                    |   19.85 |      100 |       0 |   19.85 | ...18-275,280-398,407-428 
  hasher.ts                    |   98.16 |    66.66 |     100 |   98.16 | 33,49                     
  index.ts                     |   37.66 |    92.85 |   17.07 |   37.66 | ...71-872,876-877,881-882 
  objects.ts                   |   19.04 |      100 |       0 |   19.04 | ...04-119,133-183,194-336 
 ccip-sdk/src/sui/manuallyExec |   39.46 |      100 |       0 |   39.46 |                           
  encoder.ts                   |   47.67 |      100 |       0 |   47.67 | 42-86                     
  index.ts                     |    34.3 |      100 |       0 |    34.3 | 48-137                    
 ccip-sdk/src/ton              |   73.99 |    82.72 |   63.01 |   73.99 |                           
  exec.ts                      |     100 |      100 |     100 |     100 |                           
  hasher.ts                    |   77.95 |    77.77 |      75 |   77.95 | 99-107,155-186            
  index.ts                     |   69.46 |    76.52 |      50 |   69.46 | ...11,1218-1219,1226-1227 
  logs.ts                      |     100 |    98.43 |     100 |     100 | 56                        
  send.ts                      |   96.39 |    73.91 |     100 |   96.39 | 38-45                     
  types.ts                     |   78.41 |    69.23 |   66.66 |   78.41 | ...-76,94,121-134,136-139 
  utils.ts                     |   60.88 |    83.72 |    87.5 |   60.88 | ...55-261,269-327,329-332 
-------------------------------|---------|----------|---------|---------|---------------------------

// source = await getChain(sourceNetwork.chainId)
}
}
const request = await request$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to handle the case where both requests fail. It will be confusing for the user to see at the same an rpc error and an api error

try {
source = await getChain(request.lane.sourceChainSelector)
} catch {
// pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we at least get here a logger.info or logger.debug?

const apiClient = CCIPAPIClient.fromUrl(undefined, ctx)
if (isHexString(argv.txHashOrId, 32)) {
request$ = Promise.any([request$, apiClient.getMessageById(argv.txHashOrId)])
// source = await getChain(sourceNetwork.chainId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove this line entirely?

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.

3 participants