Skip to content

feat(cct-sdk): Add get token info op solana - #405

Merged
mervin-link merged 48 commits into
cct-sdkfrom
feat/DAPP-11371-get-token-info
Sep 8, 2026
Merged

feat(cct-sdk): Add get token info op solana#405
mervin-link merged 48 commits into
cct-sdkfrom
feat/DAPP-11371-get-token-info

Conversation

@mervin-link

@mervin-link mervin-link commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

What

  • DAPP-11371
  • Add Solana CCT getTokenInfo operation and facade method
  • Return metadata plus mint program, supply, mint authority, and freeze authority
  • Add query and validation unit tests
  • Fix other lint errors
  • Fix package lock file - remove stale axios version

Why

  • Expose Solana token metadata and mint state through the CCT facade for token administration and inspection workflows

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

You must have Developer access to commit code to Chainlink Labs on Vercel. If you contact an administrator and receive Developer access, commit again to see your changes.

Learn more: https://vercel.com/docs/accounts/team-members-and-roles/access-roles#team-level-roles

Base automatically changed from feat/DAPP-11328-create-recipient-ata to cct-sdk September 8, 2026 07:35
@mervin-link
mervin-link requested a review from a team as a code owner September 8, 2026 07:35
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

CI Test Report

2506/2512 tests passed (650 suites) in 5m 2s

Summary

ℹ tests 2512
ℹ suites 650
ℹ pass 2506
ℹ fail 0
ℹ cancelled 0
ℹ skipped 6
ℹ todo 0
ℹ duration_ms 301702.542393
Coverage report
File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------------------------------|---------|----------|---------|---------|-------------------
All files                              |   84.24 |    82.87 |   76.56 |   84.24 |                   
 ccip-cli/src                          |   90.42 |    59.25 |      75 |   90.42 |                   
  index.ts                             |   90.42 |    59.25 |      75 |   90.42 | ...73-174,180-185 
 ccip-cli/src/commands                 |   52.65 |    75.47 |    62.9 |   52.65 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  lane-latency.ts                      |   70.76 |    83.33 |   33.33 |   70.76 | ...,76-83,119-128 
  lane.ts                              |   86.98 |    68.42 |     100 |   86.98 | ...41-144,148-150 
  manual-exec.ts                       |   20.34 |      100 |       0 |   20.34 | ...39-149,151-347 
  parse.ts                             |    55.2 |      100 |       0 |    55.2 | 47-51,58-65,67-96 
  search.ts                            |   81.25 |      100 |       0 |   81.25 | 24-29             
  send.ts                              |   14.13 |      100 |       0 |   14.13 | ...09-237,239-552 
  show.ts                              |   75.68 |    63.75 |     100 |   75.68 | ...15-318,399-401 
  supported-tokens.ts                  |   17.93 |      100 |       0 |   17.93 | ...80-353,355-368 
  token.ts                             |   22.72 |      100 |       0 |   22.72 | ...3,60-67,69-132 
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   87.89 |    79.48 |   96.66 |   87.89 | ...11-721,729-737 
 ccip-cli/src/commands/search          |   53.89 |    76.19 |    12.5 |   53.89 |                   
  messages.ts                          |   53.89 |    76.19 |    12.5 |   53.89 | ...36-258,260-295 
 ccip-cli/src/providers                |   53.37 |    86.45 |   21.73 |   53.37 |                   
  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                             |   81.37 |    85.71 |    90.9 |   81.37 | ...20,290,344-392 
  solana.ts                            |   47.44 |      100 |       0 |   47.44 | ...02-103,112-137 
  sui.ts                               |    49.5 |      100 |       0 |    49.5 | ...57-258,267-301 
  ton.ts                               |   15.03 |      100 |       0 |   15.03 | 24-153            
 ccip-cli/src/providers/canton         |    85.4 |    77.89 |      68 |    85.4 |                   
  auth.ts                              |   82.41 |    73.01 |   53.33 |   82.41 | ...17-333,464-469 
  config.ts                            |   80.41 |    81.81 |     100 |   80.41 | 36-43,48-58       
  index.ts                             |     100 |      100 |     100 |     100 |                   
  wallet.ts                            |   92.93 |      100 |   85.71 |   92.93 | 172-184           
 ccip-sdk/src                          |   95.43 |    88.24 |    92.9 |   95.43 |                   
  chain.ts                             |   96.49 |    83.96 |   84.37 |   96.49 | ...2427,2460-2461 
  commits.ts                           |    90.9 |    81.25 |     100 |    90.9 | ...06,115-118,120 
  execution.ts                         |   93.13 |    88.23 |     100 |   93.13 | ...53-159,192-199 
  explorer.ts                          |     100 |      100 |     100 |     100 |                   
  extra-args.ts                        |     100 |    89.47 |     100 |     100 | 225,260,297,312   
  fetch.ts                             |   98.06 |    93.56 |   97.77 |   98.06 | ...-881,1127-1129 
  gas.ts                               |   85.17 |    86.04 |      75 |   85.17 | ...83-294,403-452 
  http-status.ts                       |     100 |      100 |     100 |     100 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  messages.ts                          |    79.2 |    47.16 |      40 |    79.2 | ...99-310,314-327 
  networks.ts                          |     100 |      100 |     100 |     100 |                   
  offchain.ts                          |   84.64 |    76.92 |     100 |   84.64 | ...18-227,236-237 
  requests.ts                          |    95.4 |    90.58 |     100 |    95.4 | ...54-655,680-685 
  supported-chains.ts                  |     100 |      100 |     100 |     100 |                   
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |    99.2 |       96 |     100 |    99.2 | ...12,217-218,220 
 ccip-sdk/src/api                      |   93.22 |    83.44 |   94.73 |   93.22 |                   
  index.ts                             |   93.22 |    83.44 |   94.73 |   93.22 | ...92-895,898-901 
 ccip-sdk/src/aptos                    |   78.85 |    78.67 |   76.19 |   78.85 |                   
  exec.ts                              |   29.31 |      100 |       0 |   29.31 | 18-58             
  hasher.ts                            |   75.89 |       80 |   66.66 |   75.89 | 17-36,50-56       
  index.ts                             |   68.84 |       80 |   67.44 |   68.84 | ...1072,1076-1087 
  logs.ts                              |   96.65 |     78.2 |    92.3 |   96.65 | ...1244-1254,1731 
  send.ts                              |    25.6 |      100 |       0 |    25.6 | ...2,63-80,93-125 
  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                   |   45.32 |    76.16 |   31.66 |   45.32 |                   
  amount.ts                            |   92.59 |       70 |     100 |   92.59 | 22-23             
  ccv-addresses.ts                     |     100 |    91.07 |     100 |     100 | 13,30,64,67       
  defaults.ts                          |   99.28 |    90.24 |     100 |   99.28 | 93                
  events.ts                            |   45.38 |     52.5 |   23.52 |   45.38 | ...15-527,533-542 
  index.ts                             |   34.89 |    58.82 |   12.82 |   34.89 | ...2614,2617-2619 
  types.ts                             |   95.26 |      100 |      50 |   95.26 | 55-62             
  update-id.ts                         |   98.11 |    88.88 |     100 |   98.11 | 52                
 ccip-sdk/src/canton/authentication    |   92.93 |    79.31 |    92.3 |   92.93 |                   
  authorization-code.ts                |   89.83 |    84.31 |    90.9 |   89.83 | ...58-376,432-443 
  client-credentials.ts                |   91.28 |       75 |     100 |   91.28 | ...92-196,198-202 
  index.ts                             |    96.8 |       75 |     100 |    96.8 | 168-173           
  metadata.ts                          |   81.89 |    44.44 |      50 |   81.89 | ...55,73-78,93-94 
  static.ts                            |     100 |      100 |     100 |     100 |                   
  token-source.ts                      |   97.81 |    77.77 |     100 |   97.81 | 167-170           
  types.ts                             |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/canton/client            |    57.4 |    60.86 |   22.85 |    57.4 |                   
  client.ts                            |   55.62 |    59.09 |   22.85 |   55.62 | ...37-756,771-791 
  index.ts                             |     100 |      100 |     100 |     100 |                   
 ...dk/src/canton/explicit-disclosures |   74.81 |    69.35 |    55.1 |   74.81 |                   
  acs.ts                               |   87.36 |     69.1 |      90 |   87.36 | ...20,568,606-607 
  eds.ts                               |   54.34 |      100 |       0 |   54.34 | ...86-393,397-402 
 ccip-sdk/src/canton/token-metadata    |   61.37 |      100 |       0 |   61.37 |                   
  client.ts                            |   61.37 |      100 |       0 |   61.37 | 111-178,185-189   
 ...dk/src/canton/transfer-instruction |    52.4 |      100 |       0 |    52.4 |                   
  client.ts                            |    52.4 |      100 |       0 |    52.4 | 104-197,204-208   
 ccip-sdk/src/cct                      |     100 |    87.09 |     100 |     100 |                   
  errors.ts                            |     100 |    83.33 |     100 |     100 | 138-142,203       
  operation.ts                         |     100 |      100 |     100 |     100 |                   
  query.ts                             |     100 |      100 |     100 |     100 |                   
  token-manager.ts                     |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/cct/evm                  |   96.36 |     95.9 |    58.2 |   96.36 |                   
  index.ts                             |   94.85 |      100 |   36.36 |   94.85 | ...1234,1266-1269 
  operation.ts                         |     100 |      100 |     100 |     100 |                   
  query.ts                             |     100 |      100 |     100 |     100 |                   
  submit.ts                            |     100 |    79.16 |     100 |     100 | 28,52,68-69,87    
  validate.ts                          |     100 |      100 |     100 |     100 |                   
 .../cct/evm/artifacts/bytecode/V2_0_0 |     100 |      100 |     100 |     100 |                   
  burn-from-mint-token-pool.ts         |     100 |      100 |     100 |     100 |                   
  burn-mint-token-pool.ts              |     100 |      100 |     100 |     100 |                   
  burn-with-from-mint-token-pool.ts    |     100 |      100 |     100 |     100 |                   
  cross-chain-token.ts                 |     100 |      100 |     100 |     100 |                   
  erc20-lockbox.ts                     |     100 |      100 |     100 |     100 |                   
  lock-release-token-pool.ts           |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/cct/evm/lockbox          |     100 |      100 |     100 |     100 |                   
  contracts.ts                         |     100 |      100 |     100 |     100 |                   
 ...sdk/src/cct/evm/lockbox/operations |     100 |      100 |     100 |     100 |                   
  authorize-callers.ts                 |     100 |      100 |     100 |     100 |                   
  deploy-lockbox.ts                    |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/cct/evm/token            |    97.1 |    66.66 |      50 |    97.1 |                   
  contracts.ts                         |    97.1 |    66.66 |      50 |    97.1 | 45-46             
 ...k/src/cct/evm/token-admin-registry |     100 |      100 |     100 |     100 |                   
  contracts.ts                         |     100 |      100 |     100 |     100 |                   
 ...vm/token-admin-registry/operations |     100 |      100 |     100 |     100 |                   
  accept-admin.ts                      |     100 |      100 |     100 |     100 |                   
  get-supported-tokens.ts              |     100 |      100 |     100 |     100 |                   
  get-token-admin-registry.ts          |     100 |      100 |     100 |     100 |                   
  register-admin.ts                    |     100 |      100 |     100 |     100 |                   
  set-pool.ts                          |     100 |      100 |     100 |     100 |                   
  transfer-admin.ts                    |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/cct/evm/token-pool       |     100 |      100 |     100 |     100 |                   
  contracts.ts                         |     100 |      100 |     100 |     100 |                   
  rate-limit.ts                        |     100 |      100 |     100 |     100 |                   
  remote-pool.ts                       |     100 |      100 |     100 |     100 |                   
 .../src/cct/evm/token-pool/operations |   99.82 |    97.57 |     100 |   99.82 |                   
  add-remote-pool.ts                   |     100 |      100 |     100 |     100 |                   
  apply-allowlist-updates.ts           |     100 |    96.29 |     100 |     100 | 229               
  apply-chain-updates.ts               |     100 |      100 |     100 |     100 |                   
  deploy-token-pool.ts                 |     100 |    85.71 |     100 |     100 | 83-86             
  get-token-pool-remotes.ts            |     100 |      100 |     100 |     100 |                   
  get-token-pool-state.ts              |   98.61 |       95 |     100 |   98.61 | 282-285           
  remove-remote-pool.ts                |     100 |      100 |     100 |     100 |                   
  set-chain-rate-limiter-configs.ts    |     100 |    97.05 |     100 |     100 | 112               
  set-dynamic-config.ts                |     100 |      100 |     100 |     100 |                   
  set-rate-limit-admin.ts              |     100 |      100 |     100 |     100 |                   
  set-remote-pool.ts                   |     100 |      100 |     100 |     100 |                   
  transfer-ownership.ts                |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/cct/evm/token/operations |     100 |      100 |     100 |     100 |                   
  deploy-token.ts                      |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/cct/solana               |   99.73 |    96.78 |   97.97 |   99.73 |                   
  index.ts                             |   99.67 |      100 |   97.22 |   99.67 | 258-259,2425-2430 
  operation.ts                         |     100 |      100 |     100 |     100 |                   
  query.ts                             |     100 |      100 |     100 |     100 |                   
  serialize.ts                         |     100 |     92.3 |     100 |     100 | 27                
  submit.ts                            |     100 |    81.81 |     100 |     100 | 31,48,53,72       
  validate.ts                          |     100 |    98.05 |     100 |     100 | 214,321           
 ccip-sdk/src/cct/solana/programs      |     100 |      100 |     100 |     100 |                   
  alt.ts                               |     100 |      100 |     100 |     100 |                   
  fee-quoter.ts                        |     100 |      100 |     100 |     100 |                   
  router.ts                            |     100 |      100 |     100 |     100 |                   
  token-pool.ts                        |     100 |      100 |     100 |     100 |                   
  token.ts                             |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/cct/solana/token         |     100 |      100 |     100 |     100 |                   
  constants.ts                         |     100 |      100 |     100 |     100 |                   
 ...rc/cct/solana/token-admin-registry |     100 |      100 |     100 |     100 |                   
  constants.ts                         |     100 |      100 |     100 |     100 |                   
 ...na/token-admin-registry/operations |   99.61 |    98.74 |     100 |   99.61 |                   
  accept-admin.ts                      |     100 |      100 |     100 |     100 |                   
  append-to-lookup-table.ts            |     100 |      100 |     100 |     100 |                   
  create-lookup-table.ts               |     100 |      100 |     100 |     100 |                   
  get-supported-tokens.ts              |     100 |      100 |     100 |     100 |                   
  get-token-admin-registry.ts          |     100 |      100 |     100 |     100 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  ...override-pending-administrator.ts |     100 |      100 |     100 |     100 |                   
  register-admin.ts                    |   97.95 |    94.44 |     100 |   97.95 | 212-216           
  set-pool.ts                          |     100 |      100 |     100 |     100 |                   
  transfer-admin.ts                    |     100 |      100 |     100 |     100 |                   
 ...c/cct/solana/token-pool/operations |   99.62 |    98.23 |     100 |   99.62 |                   
  accept-ownership.ts                  |     100 |      100 |     100 |     100 |                   
  append-remote-pool-addresses.ts      |     100 |      100 |     100 |     100 |                   
  apply-chain-updates.ts               |     100 |    98.36 |     100 |     100 | 148               
  configure-allowlist.ts               |     100 |      100 |     100 |     100 |                   
  create-token-multisig.ts             |    95.9 |     92.5 |     100 |    95.9 | ...01-102,104-109 
  delete-chain-remote-config.ts        |     100 |      100 |     100 |     100 |                   
  deploy-token-pool.ts                 |     100 |      100 |     100 |     100 |                   
  edit-chain-remote-config.ts          |     100 |      100 |     100 |     100 |                   
  get-token-pool-remotes.ts            |     100 |      100 |     100 |     100 |                   
  get-token-pool-state.ts              |     100 |      100 |     100 |     100 |                   
  index.ts                             |     100 |      100 |     100 |     100 |                   
  init-chain-remote-config.ts          |     100 |      100 |     100 |     100 |                   
  provide-liquidity.ts                 |     100 |      100 |     100 |     100 |                   
  remove-from-allowlist.ts             |     100 |    94.11 |     100 |     100 | 126               
  set-can-accept-liquidity.ts          |     100 |      100 |     100 |     100 |                   
  set-chain-rate-limit.ts              |   99.11 |    96.15 |     100 |   99.11 | 64-65             
  set-rate-limit-admin.ts              |     100 |      100 |     100 |     100 |                   
  set-rebalancer.ts                    |     100 |      100 |     100 |     100 |                   
  transfer-ownership.ts                |     100 |      100 |     100 |     100 |                   
  withdraw-liquidity.ts                |     100 |      100 |     100 |     100 |                   
 ...dk/src/cct/solana/token/operations |     100 |    98.41 |     100 |     100 |                   
  approve-token.ts                     |     100 |      100 |     100 |     100 |                   
  create-token-account.ts              |     100 |      100 |     100 |     100 |                   
  deploy-token.ts                      |     100 |      100 |     100 |     100 |                   
  get-token-info.ts                    |     100 |       70 |     100 |     100 | 69,80-81          
  index.ts                             |     100 |      100 |     100 |     100 |                   
  mint-tokens.ts                       |     100 |      100 |     100 |     100 |                   
  set-token-authority.ts               |     100 |      100 |     100 |     100 |                   
  update-metadata-authority.ts         |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/errors                   |   90.42 |    77.16 |   59.55 |   90.42 |                   
  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                       |   88.26 |    73.91 |   57.36 |   88.26 | ...3636,3659-3668 
  utils.ts                             |   94.44 |    81.48 |     100 |   94.44 | 15,17,22,24       
 ccip-sdk/src/evm                      |   93.08 |    82.48 |   93.16 |   93.08 |                   
  const.ts                             |   98.66 |    92.85 |     100 |   98.66 | 122-123           
  errors.ts                            |   91.98 |    81.57 |     100 |   91.98 | ...85,239-242,247 
  extra-args.ts                        |    94.5 |    61.01 |     100 |    94.5 | ...11-212,328-340 
  fork.test.data.ts                    |     100 |      100 |     100 |     100 |                   
  gas.ts                               |   98.19 |    63.15 |     100 |   98.19 | 90-91,93          
  hasher.ts                            |     100 |     92.3 |     100 |     100 | 135               
  index.ts                             |   88.69 |    80.67 |    90.9 |   88.69 | ...2716,2871-2902 
  logs.ts                              |   99.16 |    92.02 |      90 |   99.16 | 69-70,75-76       
  messageCodec.ts                      |     100 |      100 |     100 |     100 |                   
  messages.ts                          |     100 |      100 |     100 |     100 |                   
  offchain.ts                          |    87.5 |    71.42 |     100 |    87.5 | 13-14             
  simulate.ts                          |     100 |    94.82 |     100 |     100 | 109-111,425       
  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                   |   85.32 |    84.33 |   82.35 |   85.32 |                   
  bcs-codecs.ts                        |   79.07 |    60.86 |   66.66 |   79.07 | ...42-252,260-269 
  codec.ts                             |    94.3 |    93.22 |     100 |    94.3 | 139-140,178-186   
  constants.ts                         |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/solana                   |   79.13 |    75.73 |   84.34 |   79.13 |                   
  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 
  extra-args.ts                        |   59.49 |    76.47 |      60 |   59.49 | 86-122,132-190    
  fork.test.data.ts                    |     100 |      100 |     100 |     100 |                   
  gas.ts                               |   92.06 |    68.57 |     100 |   92.06 | ...,81-90,170-171 
  hasher.ts                            |   96.49 |    81.81 |     100 |   96.49 | 64-67             
  index.ts                             |   83.03 |    78.91 |   87.03 |   83.03 | ...2129,2133-2166 
  logs.ts                              |   87.79 |    74.07 |     100 |   87.79 | ...50-151,163-164 
  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 
  signatures-cache.ts                  |   79.78 |    71.15 |    87.5 |   79.78 | ...51-260,274-275 
  token-admin-registry.ts              |     100 |    96.29 |     100 |     100 | 27                
  types.ts                             |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   81.56 |     77.1 |   83.33 |   81.56 | ...87-588,625-640 
 ccip-sdk/src/sui                      |   73.18 |    70.66 |   81.14 |   73.18 |                   
  discovery.ts                         |   47.37 |    48.27 |      60 |   47.37 | ...34-782,785-819 
  events.ts                            |   89.83 |    72.67 |     100 |   89.83 | ...19-626,685-698 
  exec.ts                              |   30.71 |      100 |       0 |   30.71 | 37-89,101-153     
  hasher.ts                            |   98.19 |    66.66 |     100 |   98.19 | 35,51             
  index.ts                             |   76.12 |    70.47 |   79.68 |   76.12 | ...2314,2330-2331 
  logs.ts                              |   97.89 |    74.02 |     100 |   97.89 | ...62-165,186-187 
  objects.ts                           |    54.6 |    83.33 |   83.33 |    54.6 | ...57-313,324-467 
  types.ts                             |     100 |      100 |     100 |     100 |                   
 ccip-sdk/src/sui/manuallyExec         |   53.36 |       75 |      50 |   53.36 |                   
  encoder.ts                           |    83.9 |    66.66 |     100 |    83.9 | 51-58,73-77,82    
  index.ts                             |   33.82 |      100 |       0 |   33.82 | 47-136            
 ccip-sdk/src/ton                      |      86 |    80.53 |   88.28 |      86 |                   
  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                             |   84.81 |     79.6 |   79.03 |   84.81 | ...2111,2118-2119 
  logs.ts                              |   93.84 |    83.43 |     100 |   93.84 | ...09-616,672-675 
  send.ts                              |   95.52 |    66.66 |     100 |   95.52 | 37-44,188         
  ton-cache.ts                         |     100 |    96.55 |     100 |     100 | 102               
  types.ts                             |   91.24 |    81.25 |     100 |   91.24 | ...61-63,71-74,92 
  utils.ts                             |    63.1 |    77.77 |    90.9 |    63.1 | ...37-395,397-400 
 scripts                               |   87.95 |    63.38 |     100 |   87.95 |                   
  test-endpoints.ts                    |   97.98 |    72.72 |     100 |   97.98 | 137-139           
  useResource.ts                       |   83.57 |    61.66 |     100 |   83.57 | ...81-286,301-302 
---------------------------------------|---------|----------|---------|---------|-------------------

@aelmanaa

aelmanaa commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Overview

APPROVE-WITH-NITS — 0 blockers, 0 correctness majors. Well-typed, sound, not a duplicate.

Adds a getTokenInfo read operation (Solana only) that returns SPL mint metadata + state:

  • symbol, name, decimals (from Metaplex or fallback)
  • supply (bigint)
  • mintAuthority, freezeAuthority (pubkey or null)
  • tokenProgram (SPL Token or Token-2022 owner)

Architecture: Read-only query (SolanaQuery base), two-phase: prepare() validates tokenAddress → read() fetches via chain.getTokenInfo() + resolveTokenMint() + unpackMint().

Live Devnet Verification:

  • Happy read on real SPL mint J9jfqxhsGM2U7V4aQ6Y2R37hDhVMMVCLYEoQMBzeJCbF → decimals=9, supply=400n (bigint), mintAuthority/freezeAuthority set, tokenProgram=Tokenkeg (SPL), symbol=UNKNOWN (correct fallback when no Metaplex metadata)
  • Issue identified (live-proven below)

Note on CI: The red "Run npm ci" is a trunk-wide cct-sdk lockfile issue (axios duplication conflict), not this PR. This PR's own code is fine; unit tests + tsc pass locally once the lock is deduped.


[COMMENT 1/5] 🔴 Medium — unpackMint leaks a raw non-CCIPError for a not-a-mint address

Problem: The current code path only validates that the account's owner is an SPL/Token-2022 program (via resolveTokenMint), but doesn't validate it's a mint account. If you pass a token account (or any other SPL-owned account like pool config), resolveTokenMint passes but unpackMint throws a raw @solana/spl-token error outside the CCIPError taxonomy — undocumented and invisible to typed error handlers (catch (e._isCCIPError)).

Live proof: Called getTokenInfo on a real SPL token account (not a mint) on devnet → threw raw TokenInvalidAccountSizeError with _isCCIPError=false. Contrast: a nonexistent account correctly throws CCIPTokenDataParseError (in-taxonomy).

Current code (simplified):

const account = await resolveTokenMint(chain.connection, mint) // only checks owner ∈ {SPL, Token-2022}
const state = unpackMint(mint, account, account.owner) // ← throws raw error if not a mint

Fix: Wrap the unpackMint decode and catch SPL errors, rethrowing as CCIPTokenMintInvalidError:

const account = await resolveTokenMint(chain.connection, mint)
let state
try {
  state = unpackMint(mint, account, account.owner)
} catch (e) {
  if (e instanceof Error && e.message.includes('TokenInvalidAccountSize')) {
    throw new CCIPTokenMintInvalidError(`Account is not a valid mint: ${e.message}`)
  }
  throw e // genuine transport error
}

This keeps "not actually a mint" in the documented error taxonomy.

@aelmanaa

aelmanaa commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

[COMMENT 2/5] 🟡 Low — Nondeterministic error type + double-fetch from Promise.all

Problem: The current code uses Promise.all([chain.getTokenInfo(...), resolveTokenMint(...)]), which causes two issues:

  1. Double-fetch: Both chain.getTokenInfo (via getParsedAccountInfo internally) and resolveTokenMint (via getAccountInfo) fetch the same mint account — one redundant RPC call per getTokenInfo.

  2. Nondeterministic errors: Different code paths throw different error types:

    • chain.getTokenInfo: throws CCIPSplTokenInvalidError for non-SPL-owned accounts
    • resolveTokenMint: throws CCIPTokenMintNotFoundError (missing) or CCIPTokenMintInvalidError (wrong owner)

    Since both run in parallel via Promise.all, whichever rejects first is what the caller sees. This means "mint not found" isn't reliably catchable — the error type is a race condition.

Current code:

const [info, account] = await Promise.all([
  chain.getTokenInfo(tokenAddress),
  resolveTokenMint(chain.connection, mint),
])
const state = unpackMint(mint, account, account.owner)

Fix — sequence and reuse: Fetch the mint account first (deterministic, specific errors), then reuse its result for unpacking, and call chain.getTokenInfo only for symbol/name:

const account = await resolveTokenMint(chain.connection, mint) // First: validate + fetch
let state
try {
  state = unpackMint(mint, account, account.owner)
} catch (e) {
  // Handle raw SPL errors (see comment 1)
  throw new CCIPTokenMintInvalidError(...)
}

const info = await chain.getTokenInfo(tokenAddress) // Second: metadata only (optional cacheable)

return {
  ...info,
  tokenProgram: account.owner.toBase58(),
  supply: state.supply,
  mintAuthority: state.mintAuthority?.toBase58() ?? null,
  freezeAuthority: state.freezeAuthority?.toBase58() ?? null,
}

Benefits:

  • One fetch instead of two (minor RPC optimization)
  • Deterministic error order: validation failures (mint not found, invalid owner) surface first, predictably
  • Solves comment 1's raw-error leak in the same change

@aelmanaa

aelmanaa commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

[COMMENT 3/5] 🔵 Low (Completeness) — isInitialized field omitted

Context: unpackMint returns the full mint state including an isInitialized boolean that indicates whether the mint account has been set up. The current GetTokenInfoResult drops this field.

Question: Is this a deliberate omission, or should it be included for completeness?

Options:

  1. Include it: Add isInitialized: boolean to GetTokenInfoResult for full mint state visibility. Since the op's purpose is "read all mint state," this is consistent.
  2. Document the omission: If it's intentional (e.g., "we only expose authorities, not account lifecycle state"), add a JSDoc note: @remarks isInitialized is available from the mint account but not exposed; only authorities and supply are returned.

Recommendation: Include it — it's part of the mint state being unpacked, and consumers might need it for validation logic.

@aelmanaa

aelmanaa commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

[COMMENT 4/5] 🔵 Nits (DX) — Cross-references, @throws, parity note

  1. @see links: Add pointers to related operations:

    • setTokenAuthority / updateMetadataAuthority — this read returns exactly the authorities they mutate
    • getTokenPoolState — clarify this reads the mint (base token) not the pool state (pool config)
    • SolanaChain.getTokenInfo — note the name similarity (core supply of symbol/decimals; this extends it with mint state)
  2. @throws on the operation class: The facade method has @throws, but the GetTokenInfo class itself carries no @throws JSDoc. Add brief throws documentation to the class so the error contract is clear at both levels.

  3. Cross-family parity note: Add a one-line remark noting this is Solana-only and that no EVM CCT getTokenInfo equivalent exists (EVM CCT reads are pool/registry-only). Mirrors the precedent set by getTokenPoolState's cross-family note, so consumers aware that this surface is Solana-specific.

Example addition to facade:

/**
 * Reads an SPL token mint's metadata, program, supply, and mint/freeze authorities.
 *
 * @remarks 
 * Metadata comes from {@link SolanaChain.getTokenInfo}; mint state comes directly from
 * the SPL Token or Token-2022 mint account. Supply is in base units. **Solana-only** — no
 * EVM equivalent exists.
 *
 * @see {@link setTokenAuthority} — sets the authorities returned here
 * @see {@link updateMetadataAuthority} — updates metadata authority
 * @see {@link getTokenPoolState} — reads pool configuration (not mint)
 * @see {@link SolanaChain.getTokenInfo} — core implementation (symbol/decimals only)
 *
 * @throws {@link CCTParamsInvalidError} If `tokenAddress` is not a valid Solana public key.
 * @throws {@link CCIPSplTokenInvalidError} If the mint is not owned by an SPL Token program.
 * @throws {@link CCIPTokenMintNotFoundError} If the mint account does not exist.
 * @throws {@link CCIPTokenMintInvalidError} If the mint account is not a valid mint.
 * @throws {@link CCIPTokenDataParseError} If the mint data cannot be parsed.
 */

@aelmanaa

aelmanaa commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

[COMMENT 5/5] 📋 Informational — CI status & cross-family context

CI Status (not this PR)

The red "Run npm ci" failure is a trunk-wide cct-sdk lockfile issue, not caused by this PR. The issue:

  • package-lock.json carries two axios versions: root 1.19.0 (from Ledger/TON deps) and nested ccip-sdk 1.20.0
  • npm ci's prepare build fails on a ccip-cli tsc AxiosRequestTransformer type conflict
  • Every CCT branch inherits this until the lock is regenerated

Fix (once, at cct-sdk): rm package-lock.json && npm install to deduplicate axios to a single 1.20.0. This PR's own code is fine — unit tests + tsc pass locally once the lock is deduped.

Cross-Family Parity

This PR adds a Solana-only read. There is no EVM CCT getTokenInfo equivalent (EVM CCT reads are currently pool/registry-only, no token metadata reads). This is intentional design (EVM ecosystem has contract state fragmentation across Uniswap/Curve/custom pools); document it so consumers know this surface is Solana-specific, or follow up with an EVM ERC-20 symbol/decimals/totalSupply read in a companion PR to close the parity gap.

@mervin-link

Copy link
Copy Markdown
Collaborator Author

Overview

APPROVE-WITH-NITS — 0 blockers, 0 correctness majors. Well-typed, sound, not a duplicate.

Adds a getTokenInfo read operation (Solana only) that returns SPL mint metadata + state:

  • symbol, name, decimals (from Metaplex or fallback)
  • supply (bigint)
  • mintAuthority, freezeAuthority (pubkey or null)
  • tokenProgram (SPL Token or Token-2022 owner)

Architecture: Read-only query (SolanaQuery base), two-phase: prepare() validates tokenAddress → read() fetches via chain.getTokenInfo() + resolveTokenMint() + unpackMint().

Live Devnet Verification:

  • Happy read on real SPL mint J9jfqxhsGM2U7V4aQ6Y2R37hDhVMMVCLYEoQMBzeJCbF → decimals=9, supply=400n (bigint), mintAuthority/freezeAuthority set, tokenProgram=Tokenkeg (SPL), symbol=UNKNOWN (correct fallback when no Metaplex metadata)
  • Issue identified (live-proven below)

Note on CI: The red "Run npm ci" is a trunk-wide cct-sdk lockfile issue (axios duplication conflict), not this PR. This PR's own code is fine; unit tests + tsc pass locally once the lock is deduped.

[COMMENT 1/5] 🔴 Medium — unpackMint leaks a raw non-CCIPError for a not-a-mint address

Problem: The current code path only validates that the account's owner is an SPL/Token-2022 program (via resolveTokenMint), but doesn't validate it's a mint account. If you pass a token account (or any other SPL-owned account like pool config), resolveTokenMint passes but unpackMint throws a raw @solana/spl-token error outside the CCIPError taxonomy — undocumented and invisible to typed error handlers (catch (e._isCCIPError)).

Live proof: Called getTokenInfo on a real SPL token account (not a mint) on devnet → threw raw TokenInvalidAccountSizeError with _isCCIPError=false. Contrast: a nonexistent account correctly throws CCIPTokenDataParseError (in-taxonomy).

Current code (simplified):

const account = await resolveTokenMint(chain.connection, mint) // only checks owner ∈ {SPL, Token-2022}
const state = unpackMint(mint, account, account.owner) // ← throws raw error if not a mint

Fix: Wrap the unpackMint decode and catch SPL errors, rethrowing as CCIPTokenMintInvalidError:

const account = await resolveTokenMint(chain.connection, mint)
let state
try {
  state = unpackMint(mint, account, account.owner)
} catch (e) {
  if (e instanceof Error && e.message.includes('TokenInvalidAccountSize')) {
    throw new CCIPTokenMintInvalidError(`Account is not a valid mint: ${e.message}`)
  }
  throw e // genuine transport error
}

This keeps "not actually a mint" in the documented error taxonomy.

@aelmanaa Addressed all comments except for #5 which was already handled by different PR.

* feat: add createPoolSignerATA option to deploy token pool op

* fix: address comments
@mervin-link
mervin-link merged commit eb2fd9f into cct-sdk Sep 8, 2026
3 of 4 checks passed
@mervin-link
mervin-link deleted the feat/DAPP-11371-get-token-info branch September 8, 2026 12:26
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