Skip to content

BPS fees in tokenPoolConfig + "estimate all fees" preflight check#166

Open
PabloMansanet wants to merge 22 commits intomainfrom
token-transfer-fee
Open

BPS fees in tokenPoolConfig + "estimate all fees" preflight check#166
PabloMansanet wants to merge 22 commits intomainfrom
token-transfer-fee

Conversation

@PabloMansanet
Copy link
Collaborator

@PabloMansanet PabloMansanet commented Mar 5, 2026

NOTE: Fork test support for USDC transfers in particular is limited because our CCTP token pool for V2 lanes is incomplete: The deployed USDC token pool proxies aren't up to date so they lack the ability to retrieve the Verifier address from them. The fork tests do exercise every part of the logic separately though, so hopefully that should give us enough confidence.

@PabloMansanet PabloMansanet requested a review from a team as a code owner March 5, 2026 13:25
@vercel
Copy link

vercel bot commented Mar 5, 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 Mar 16, 2026 4:06pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

👋 PabloMansanet, 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

github-actions bot commented Mar 5, 2026

Coverage Report

ℹ tests 768
ℹ suites 221
ℹ pass 766
ℹ fail 0
ℹ cancelled 0
ℹ skipped 2
ℹ todo 0
ℹ duration_ms 63345.087924

> @chainlink/ccip-cli@1.2.1 test
> node --test

▶ lane-latency command
  ✔ should output JSON format correctly (6.166886ms)
  ✔ should resolve chain IDs to chain selectors (0.856996ms)
  ✔ should use custom API URL when provided (0.793056ms)
  ✔ should output log format correctly (0.87512ms)
  ✔ should handle chain IDs as input (0.740377ms)
  ✔ should handle chain selectors as input (0.76854ms)
  ✔ should throw CCIPApiClientNotAvailableError when --no-api flag is set (1.384414ms)
  ✔ should work normally when --no-api flag is false (0.628047ms)
  ✔ should forward blockConfirmations to API URL (0.567062ms)
  ✔ should not include numOfBlocks when blockConfirmations is not provided (0.654175ms)
  ▶ CCIP_API environment variable integration
    ✔ should respect CCIP_API=false environment variable (0.582171ms)
  ✔ CCIP_API environment variable integration (0.78989ms)
✔ lane-latency command (16.591559ms)
▶ e2e command show EVM
  ▶ pretty format (default)
    ✔ should show complete CCIP transaction details EVM to EVM (7878.09512ms)
  ✔ pretty format (default) (7885.130593ms)
  ▶ json format
    ✔ should output valid JSON with all expected fields (6652.950545ms)
  ✔ json format (6653.273313ms)
  ▶ log format
    ✔ should output in log format with object assignments (6288.927612ms)
  ✔ log format (6289.262923ms)
  ▶ verbose flag
    ✔ should work with verbose flag enabled (7118.899802ms)
  ✔ verbose flag (7119.113779ms)
  ▶ error handling
    ✔ should handle invalid transaction hash gracefully (5495.604ms)
    ✔ should require transaction hash argument (1540.248055ms)
  ✔ error handling (7036.123126ms)
  ✔ should show complete CCIP transaction details EVM to Aptos (6859.58141ms)
  ✔ should show complete CCIP transaction details EVM to Solana (8134.918899ms)
✔ e2e command show EVM (49978.703607ms)
▶ e2e command show Solana
  ✔ should show complete CCIP transaction details Solana to EVM (7400.83099ms)
✔ e2e command show Solana (7401.088596ms)
▶ e2e command show Aptos
  ✔ should show complete CCIP transaction details Aptos to EVM (5633.603661ms)
✔ e2e command show Aptos (5633.802386ms)
﹣ e2e command show TON (0.060775ms) # SKIP
▶ formatCCIPError
  ✔ should return null for non-CCIPError instances (1.228993ms)
  ✔ should format CCIPError with code and message (0.750847ms)
  ✔ should include help section with recovery hint (0.231704ms)
  ✔ should include note section for transient errors (0.281608ms)
  ✔ should include retry timing for transient errors with retryAfterMs (0.288611ms)
  ✔ should not include note section for permanent errors (0.20251ms)
  ✔ should format error with structured output (0.262922ms)
  ✔ should include stack trace when verbose is true (0.372058ms)
  ✔ should not include stack trace when verbose is false (0.219542ms)
✔ formatCCIPError (5.57164ms)
ℹ tests 30
ℹ suites 12
ℹ pass 30
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 63234.261142
-------------------------------|---------|----------|---------|---------|---------------------------
File                           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s         
-------------------------------|---------|----------|---------|---------|---------------------------
All files                      |   72.74 |    77.66 |   58.84 |   72.74 |                           
 ccip-cli/src                  |   83.78 |    77.77 |      50 |   83.78 |                           
  index.ts                     |   83.78 |    77.77 |      50 |   83.78 | ...64,87-91,97-98,103-108 
 ccip-cli/src/commands         |   52.72 |     72.3 |   53.84 |   52.72 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  lane-latency.ts              |   72.56 |     90.9 |   33.33 |   72.56 | 41-56,63-70,105-111       
  manual-exec.ts               |   26.43 |      100 |       0 |   26.43 | 61-114,121-131,133-259    
  parse.ts                     |   57.14 |      100 |       0 |   57.14 | 46-50,57-64,66-91         
  send.ts                      |    16.5 |      100 |       0 |    16.5 | ...71-178,188-217,219-412 
  show.ts                      |   88.76 |     62.5 |      60 |   88.76 | ...78-180,189-190,230-231 
  supported-tokens.ts          |   20.64 |      100 |       0 |   20.64 | ...99-209,211-266,268-281 
  token.ts                     |   22.72 |      100 |       0 |   22.72 | 24-53,60-67,69-132        
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   85.29 |    73.38 |    92.3 |   85.29 | ...85-595,603-611,621-627 
 ccip-cli/src/providers        |    51.9 |    75.51 |      16 |    51.9 |                           
  aptos.ts                     |   53.65 |      100 |       0 |   53.65 | ...70,78-85,91-92,101-123 
  evm.ts                       |    39.7 |      100 |       0 |    39.7 | 23,40-50,56-85,97-136     
  index.ts                     |   81.65 |    72.72 |      80 |   81.65 | 50-51,190-229             
  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.4 |    81.87 |   93.67 |    94.4 |                           
  chain.ts                     |   93.31 |    80.28 |      75 |   93.31 | ...02,1546-1547,1636-1637 
  commits.ts                   |     100 |    94.73 |     100 |     100 | 52                        
  execution.ts                 |   92.19 |     92.3 |     100 |   92.19 | 130-137,149-156           
  explorer.ts                  |     100 |      100 |     100 |     100 |                           
  extra-args.ts                |     100 |    86.66 |     100 |     100 | 179,214                   
  gas.ts                       |   89.69 |       40 |     100 |   89.69 | 107-118,146-150           
  http-status.ts               |     100 |      100 |     100 |     100 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  messages.ts                  |   88.48 |    45.09 |     100 |   88.48 | ...19-220,229-230,254-255 
  offchain.ts                  |   91.91 |    76.74 |     100 |   91.91 | ...89,207,222-224,226-232 
  requests.ts                  |   90.89 |    81.08 |     100 |   90.89 | ...65-369,434-435,439-440 
  supported-chains.ts          |     100 |      100 |     100 |     100 |                           
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   96.36 |    90.61 |     100 |   96.36 | ...43,759,856-857,864-872 
 ccip-sdk/src/api              |   93.65 |    84.61 |   94.11 |   93.65 |                           
  index.ts                     |   93.65 |    84.61 |   94.11 |   93.65 | ...26-731,742-745,748-751 
 ccip-sdk/src/aptos            |   56.49 |    69.92 |   56.66 |   56.49 |                           
  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 |    75.67 |   59.52 |      58 | ...83-721,725-827,831-842 
  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           |   87.26 |    77.25 |   47.58 |   87.26 |                           
  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               |   84.49 |    72.61 |   44.91 |   84.49 | ...20,3341-3350,3371-3380 
  utils.ts                     |   94.44 |    81.48 |     100 |   94.44 | 15,17,22,24               
 ccip-sdk/src/evm              |   83.85 |    75.42 |   88.75 |   83.85 |                           
  const.ts                     |     100 |      100 |     100 |     100 |                           
  errors.ts                    |   86.42 |    79.22 |     100 |   86.42 | ...12-113,159-161,202-220 
  extra-args.ts                |   94.44 |    62.29 |     100 |   94.44 | ...82-183,208-209,326-338 
  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 | 134                       
  index.ts                     |   81.83 |    75.86 |   91.52 |   81.83 | ...70,2035-2051,2077-2084 
  logs.ts                      |   34.32 |    68.42 |      25 |   34.32 | ...13-214,229-258,275-302 
  messages.ts                  |     100 |      100 |     100 |     100 |                           
  offchain.ts                  |   56.25 |      100 |       0 |   56.25 | 10-16                     
  types.ts                     |     100 |      100 |     100 |     100 |                           
 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           |   52.97 |    69.36 |   54.76 |   52.97 |                           
  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                     |   73.08 |    74.28 |    64.7 |   73.08 | ...15,1519-1543,1547-1568 
  logs.ts                      |   74.19 |    27.27 |     100 |   74.19 | ...,50-51,53-54,56-88,119 
  offchain.ts                  |   62.22 |      100 |       0 |   62.22 | 29-45                     
  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.27 |    77.77 |   54.54 |   54.27 | ...40-353,395-458,464-479 
 ccip-sdk/src/sui              |   32.79 |       90 |   17.24 |   32.79 |                           
  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 
  exec.ts                      |   31.29 |      100 |       0 |   31.29 | 31-74,86-131              
  hasher.ts                    |   98.16 |    66.66 |     100 |   98.16 | 33,49                     
  index.ts                     |   40.88 |    93.61 |   17.94 |   40.88 | ...98-799,803-804,808-809 
  objects.ts                   |   18.93 |      100 |       0 |   18.93 | ...04-119,133-184,195-338 
 ccip-sdk/src/sui/manuallyExec |   39.63 |      100 |       0 |   39.63 |                           
  encoder.ts                   |   47.67 |      100 |       0 |   47.67 | 42-86                     
  index.ts                     |   34.35 |      100 |       0 |   34.35 | 46-131                    
 ccip-sdk/src/ton              |   74.33 |    82.68 |   65.75 |   74.33 |                           
  exec.ts                      |     100 |      100 |     100 |     100 |                           
  hasher.ts                    |   77.95 |    77.77 |      75 |   77.95 | 99-107,155-186            
  index.ts                     |   70.33 |    76.98 |   54.34 |   70.33 | ...37,1244-1245,1252-1253 
  logs.ts                      |     100 |    98.43 |     100 |     100 | 56                        
  send.ts                      |   96.39 |    73.91 |     100 |   96.39 | 38-45                     
  types.ts                     |   77.94 |    69.23 |   66.66 |   77.94 | ...-73,91,118-131,133-136 
  utils.ts                     |   60.88 |    83.72 |    87.5 |   60.88 | ...55-261,269-327,329-332 
-------------------------------|---------|----------|---------|---------|---------------------------

@PabloMansanet PabloMansanet changed the title Add getTokenPoolFee method to chain + implement for EVM BPS fees in tokenPoolConfig + "estimate all fees" preflight check Mar 12, 2026
@PabloMansanet PabloMansanet marked this pull request as ready for review March 12, 2026 12:44
aelmanaa
aelmanaa previously approved these changes Mar 16, 2026
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