Skip to content

Conversation

@andrevmatos
Copy link
Collaborator

  • rename remaining fetch* to get* methods
  • convert methods with >2 arguments (besides opts/ctx) to single destructured object argument

@andrevmatos andrevmatos self-assigned this Dec 24, 2025
@vercel
Copy link

vercel bot commented Dec 24, 2025

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

Project Deployment Review Updated (UTC)
ccip-tools-ts Error Error Dec 26, 2025 4:35pm

@github-actions
Copy link

github-actions bot commented Dec 24, 2025

Coverage Report

ℹ tests 607
ℹ suites 193
ℹ pass 607
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 24837.957186

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

▶ lane-latency command
  ✔ should output JSON format correctly (5.475656ms)
  ✔ should resolve chain IDs to chain selectors (0.746682ms)
  ✔ should use custom API URL when provided (0.759325ms)
  ✔ should output log format correctly (1.069504ms)
  ✔ should handle chain IDs as input (0.801203ms)
  ✔ should handle chain selectors as input (0.634883ms)
  ✔ should throw CCIPApiClientNotAvailableError when --no-api flag is set (2.310828ms)
  ✔ should work normally when --no-api flag is false (0.60104ms)
  ▶ CCIP_NO_API environment variable integration
    ✔ should respect CCIP_NO_API=true environment variable (0.809219ms)
  ✔ CCIP_NO_API environment variable integration (1.065206ms)
✔ lane-latency command (17.143955ms)
▶ e2e command show EVM
  ▶ pretty format (default)
    ✔ should show complete CCIP transaction details EVM to EVM (7560.057913ms)
  ✔ pretty format (default) (7561.290121ms)
  ▶ json format
    ✔ should output valid JSON with all expected fields (5563.028805ms)
  ✔ json format (5563.226213ms)
  ▶ log format
    ✔ should output in log format with object assignments (5549.316252ms)
  ✔ log format (5549.53493ms)
  ▶ verbose flag
    ✔ should work with verbose flag enabled (6480.30059ms)
  ✔ verbose flag (6480.515731ms)
  ▶ error handling
    ✔ should handle invalid transaction hash gracefully (2155.446036ms)
    ✔ should require transaction hash argument (1594.19849ms)
  ✔ error handling (3749.92ms)
  ✔ should show complete CCIP transaction details EVM to Aptos (5291.959922ms)
  ✔ should show complete CCIP transaction details EVM to Solana (3483.669523ms)
✔ e2e command show EVM (37683.30156ms)
▶ e2e command show Solana
  ✔ should show complete CCIP transaction details Solana to EVM (4885.725856ms)
✔ e2e command show Solana (4885.973889ms)
▶ e2e command show Aptos
  ✔ should show complete CCIP transaction details Aptos to EVM (5578.094256ms)
✔ e2e command show Aptos (5578.314827ms)
▶ e2e command show TON
  ✔ should show complete CCIP transaction details TON to EVM (4957.322328ms)
  ✔ should show complete CCIP transaction details EVM to TON (44173.531592ms)
✔ e2e command show TON (49131.120988ms)
▶ formatCCIPError
  ✔ should return null for non-CCIPError instances (1.68974ms)
  ✔ should format CCIPError with code and message (0.58995ms)
  ✔ should include help section with recovery hint (0.282607ms)
  ✔ should include note section for transient errors (0.427867ms)
  ✔ should include retry timing for transient errors with retryAfterMs (0.415244ms)
  ✔ should not include note section for permanent errors (0.279842ms)
  ✔ should format error with structured output (0.293357ms)
  ✔ should include stack trace when verbose is true (0.542101ms)
  ✔ should not include stack trace when verbose is false (0.284701ms)
✔ formatCCIPError (7.122004ms)
ℹ tests 30
ℹ suites 12
ℹ pass 30
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 97461.337796
-------------------------------|---------|----------|---------|---------|---------------------------
File                           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s         
-------------------------------|---------|----------|---------|---------|---------------------------
All files                      |   67.15 |    78.96 |    56.7 |   67.15 |                           
 ccip-cli/src                  |   86.59 |    83.33 |      50 |   86.59 |                           
  index.ts                     |   86.59 |    83.33 |      50 |   86.59 | 73-77,83-84,89-94         
 ccip-cli/src/commands         |   53.09 |    78.33 |   55.55 |   53.09 |                           
  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               |      21 |      100 |       0 |      21 | 42-106,113-123,125-236    
  parse.ts                     |   41.79 |      100 |       0 |   41.79 | 22-26,33-40,42-67         
  send.ts                      |   11.62 |      100 |       0 |   11.62 | 34-136,143-150,152-344    
  show.ts                      |   89.65 |     62.5 |      60 |   89.65 | ...23-129,135-137,146-147 
  supported-tokens.ts          |   23.48 |      100 |       0 |   23.48 | ...83-175,177-232,234-247 
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   86.59 |    83.05 |    91.3 |   86.59 | ...99-517,524-532,542-548 
 ccip-cli/src/providers        |   59.73 |       75 |   17.39 |   59.73 |                           
  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                     |   82.88 |    72.09 |      80 |   82.88 | 48-49,187-222             
  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                       |   19.35 |      100 |       0 |   19.35 | 13-62                     
 ccip-sdk/src                  |   93.17 |    87.64 |   92.59 |   93.17 |                           
  chain.ts                     |    92.7 |    84.61 |   71.42 |    92.7 | ...30,249-287,575,633-642 
  commits.ts                   |     100 |       90 |     100 |     100 | 35,52                     
  execution.ts                 |   84.61 |      100 |      75 |   84.61 | 122-143                   
  explorer.ts                  |     100 |      100 |     100 |     100 |                           
  extra-args.ts                |     100 |    78.57 |     100 |     100 | 71,90,103                 
  gas.ts                       |   96.42 |    92.85 |     100 |   96.42 | 81-85                     
  http-status.ts               |     100 |      100 |     100 |     100 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  offchain.ts                  |     100 |      100 |     100 |     100 |                           
  requests.ts                  |   78.97 |    76.92 |   85.71 |   78.97 | ...02-303,307-308,331-352 
  supported-chains.ts          |     100 |      100 |     100 |     100 |                           
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   94.85 |    89.01 |     100 |   94.85 | ...56,501-502,509,566-574 
 ccip-sdk/src/api              |     100 |    94.73 |     100 |     100 |                           
  index.ts                     |     100 |    94.73 |     100 |     100 | 145                       
 ccip-sdk/src/aptos            |   57.74 |    68.53 |      60 |   57.74 |                           
  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.62 |     71.6 |   62.22 |   58.62 | ...98-733,737-830,834-845 
  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                     |   69.72 |      100 |       0 |   69.72 | 25-32,77-101              
  utils.ts                     |     100 |      100 |     100 |     100 |                           
 ccip-sdk/src/errors           |   80.74 |    76.38 |   48.67 |   80.74 |                           
  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               |   72.96 |    71.52 |   45.79 |   72.96 | ...38,1646-1655,1663-1672 
  utils.ts                     |   94.52 |    77.77 |     100 |   94.52 | 16,18,23,25               
 ccip-sdk/src/evm              |      65 |    78.94 |   62.85 |      65 |                           
  const.ts                     |     100 |      100 |     100 |     100 |                           
  errors.ts                    |   82.48 |    78.46 |     100 |   82.48 | ...55-157,188-195,198-216 
  hasher.ts                    |     100 |     87.5 |     100 |     100 | 122                       
  index.ts                     |   58.69 |    84.44 |   58.49 |   58.69 | ...03,1307-1380,1384-1433 
  logs.ts                      |   33.99 |    46.66 |      25 |   33.99 | ...13-214,229-258,274-302 
  messages.ts                  |     100 |      100 |     100 |     100 |                           
  offchain.ts                  |    80.3 |    55.17 |      75 |    80.3 | ...44-146,150-164,190-195 
 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/solana           |   51.33 |    64.54 |   55.81 |   51.33 |                           
  cleanup.ts                   |   12.22 |      100 |       0 |   12.22 | 29-229                    
  exec.ts                      |    9.18 |      100 |       0 |    9.18 | ...66-341,343-382,384-501 
  hasher.ts                    |   96.58 |    81.81 |     100 |   96.58 | 67-70                     
  index.ts                     |   70.19 |    68.75 |   64.15 |   70.19 | ...12,1416-1440,1444-1465 
  logs.ts                      |   74.19 |    29.41 |     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                      |   14.84 |      100 |       0 |   14.84 | ...63-252,265-331,333-384 
  types.ts                     |   74.46 |      100 |       0 |   74.46 | 36-47                     
  utils.ts                     |   54.14 |    77.77 |      60 |   54.14 | ...71-284,326-389,395-410 
 ccip-sdk/src/sui              |   30.72 |    76.47 |   11.11 |   30.72 |                           
  discovery.ts                 |   15.95 |      100 |       0 |   15.95 | 18-40,50-163              
  events.ts                    |   29.84 |      100 |       0 |   29.84 | ...83-154,199-292,300-325 
  hasher.ts                    |   98.16 |    66.66 |     100 |   98.16 | 33,49                     
  index.ts                     |   33.33 |       80 |     7.5 |   33.33 | ...35-736,740-741,745-746 
  objects.ts                   |   12.29 |      100 |       0 |   12.29 | ...03-144,155-205,216-358 
 ccip-sdk/src/sui/manuallyExec |   37.33 |      100 |       0 |   37.33 |                           
  encoder.ts                   |   44.31 |      100 |       0 |   44.31 | 40-88                     
  index.ts                     |   32.84 |      100 |       0 |   32.84 | 46-137                    
 ccip-sdk/src/ton              |   86.65 |    84.61 |   74.32 |   86.65 |                           
  exec.ts                      |     100 |      100 |     100 |     100 |                           
  hasher.ts                    |   77.71 |    77.77 |      75 |   77.71 | 97-105,153-184            
  index.ts                     |   93.35 |    86.41 |   68.08 |   93.35 | ...13,1017-1018,1022-1023 
  logs.ts                      |   90.33 |    92.04 |   85.71 |   90.33 | ...50-151,162-164,171-195 
  types.ts                     |   79.02 |    76.47 |   66.66 |   79.02 | ...-80,98,125-138,140-143 
  utils.ts                     |   75.09 |    72.85 |     100 |   75.09 | ...75-381,393-447,449-452 
 ccip-sdk/src/ton/bindings     |   96.56 |       90 |     100 |   96.56 |                           
  offramp.ts                   |   95.83 |    83.33 |     100 |   95.83 | 83-86                     
  onramp.ts                    |   94.44 |    83.33 |     100 |   94.44 | 65-68                     
  router.ts                    |     100 |      100 |     100 |     100 |                           
-------------------------------|---------|----------|---------|---------|---------------------------

router,
destChainSelector,
message,
}: Parameters<Chain['getFee']>[0]): Promise<bigint> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't you directly reference SendMessageOpts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As I had mentioned in message, I want the SoT to be the actual method declarations; in this case, for example, getFee could chose to omit some property from the required type (which is kinda common between getFee, generateUnsignedSendMessage and sendMessage), so referencing the actual method allows that to always stay in sync. The explicit type is used only for docs purpose

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You can even see this now, where getFee omits approveMax, which is common to generateUnsignedSendMessage and sendMessage

/**
* Common options for [[generateUnsignedSendMessage]] and [[sendMessage]] Chain methods
*/
export type SendMessageOpts = {
Copy link
Collaborator

@aelmanaa aelmanaa Dec 26, 2025

Choose a reason for hiding this comment

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

Are we reexporting SendMessageOpts and ExecuteReportOpts from index?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, because I said, I don't want them to be used/referred directly, and instead the actual declarations to be the reference point

commit?: CCIPCommit,
hints?: Pick<LogFilter, 'page' | 'watch'>,
): AsyncIterableIterator<CCIPExecution> {
async *getExecutionReceipts({
Copy link
Collaborator

Choose a reason for hiding this comment

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

why we don't use name types for consistency with the other methods?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because I don't want those named types to be used, much less these with a single use: I don't want to pollute namespace with type(aliases) which are used only once.
Those 2 which I named (SendMessageOpts, ExecuteReportOpts), are only because they're used (locally) multiple times.

for consistency with other method names
@andrevmatos andrevmatos marked this pull request as ready for review December 26, 2025 18:41
@andrevmatos andrevmatos requested a review from a team as a code owner December 26, 2025 18:41
@andrevmatos andrevmatos merged commit c6c6e75 into main Dec 26, 2025
10 of 11 checks passed
@andrevmatos andrevmatos deleted the refactor/get branch December 26, 2025 18:42
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