Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
1c36578
Initialize CCT SDK with setPool
apedrob Jun 12, 2026
3628203
Merge branch 'main' into feature/DAPP-10175-cct-sdk-set-pool
apedrob Jun 15, 2026
6fe7f8c
Merge branch 'main' into feature/DAPP-10175-cct-sdk-set-pool
apedrob Jun 18, 2026
8cc5de6
Merge branch 'main' into feature/DAPP-10175-cct-sdk-set-pool
apedrob Jun 22, 2026
387479d
Fix linting
apedrob Jun 22, 2026
64fcf80
Merge branch 'main' into feature/DAPP-10175-cct-sdk-set-pool
apedrob Jun 30, 2026
93ea5a3
feat: add solana set pool cct feature
mervin-link Jul 3, 2026
0fecb63
fix: add test files
mervin-link Jul 7, 2026
b91ffc6
Better separation of concerns and abstractions
apedrob Jul 6, 2026
fc3ed92
Merge branch 'main' into feature/DAPP-10175-cct-sdk-set-pool
apedrob Jul 7, 2026
e97306d
fix: merge conflicts and apply abstract classes
mervin-link Jul 8, 2026
214b7cd
fix: rename utils to serialize
mervin-link Jul 8, 2026
a7f2e11
feat: add create lookup table solana
mervin-link Jul 8, 2026
d3d6038
fix: submit to handle transient errors and add writable indexes as ne…
mervin-link Jul 8, 2026
9875952
fix: create ALT new abstract op class
mervin-link Jul 8, 2026
ecbafc7
feat: add compute units field
mervin-link Jul 9, 2026
ac15827
Address PR comments
apedrob Jul 9, 2026
839d16e
Merge branch 'feature/DAPP-10175-cct-sdk-set-pool' into feat/solana-s…
mervin-link Jul 9, 2026
fca9dc5
fix: address comments
mervin-link Jul 9, 2026
76a7bb4
Merge branch 'feat/solana-set-pool-cct-poc' into feat/create-lookup-t…
mervin-link Jul 9, 2026
c3a41b5
fix: rename encode to buildUnsigned
mervin-link Jul 9, 2026
bc2a58a
fix: merge conflicts
mervin-link Jul 9, 2026
d52a6f7
Rename token admin folder
apedrob Jul 9, 2026
9f61f94
fix: export errors, params, returns and flatten tokenmanager
mervin-link Jul 10, 2026
c0b1484
fix: merge conflicts
mervin-link Jul 10, 2026
4b28408
fix: address comments
mervin-link Jul 10, 2026
17e748d
fix: duplicate result type
mervin-link Jul 10, 2026
e6cfa01
feat: add two ALT mode: create+extend or createEmpty
mervin-link Jul 10, 2026
dae8d03
fix: add checks to make sure authority === payer when mode is create+…
mervin-link Jul 10, 2026
5481958
feat: add append to lookup table op
mervin-link Jul 10, 2026
a78cf3f
fix: add own create alt instruction
mervin-link Jul 13, 2026
5046b1f
fix: merge conflicts
mervin-link Jul 13, 2026
1c0f2a1
Add @examples
apedrob Jul 13, 2026
659a810
Merge remote-tracking branch 'origin/main' into feature/DAPP-10175-cc…
apedrob Jul 13, 2026
377d435
Merge branch 'feature/DAPP-10175-cct-sdk-set-pool' into feat/solana-s…
mervin-link Jul 13, 2026
9d34705
Merge branch 'feat/solana-set-pool-cct-poc' into feat/create-lookup-t…
mervin-link Jul 13, 2026
6b3070d
Ran generate and lint
apedrob Jul 13, 2026
517a1d9
fix: import buffer and ix type
mervin-link Jul 13, 2026
4d116e3
fix: address comments
mervin-link Jul 13, 2026
0511cc6
fix: add tsdoc
mervin-link Jul 13, 2026
f81b9be
feat(cct-sdk): Add solana set pool feature (#290)
mervin-link Jul 14, 2026
9ace78e
fix: remove helper function and override execute
mervin-link Jul 14, 2026
3959fb3
Merge branch 'feature/DAPP-10175-cct-sdk-set-pool' into feat/create-l…
mervin-link Jul 14, 2026
384b88b
Merge branch 'feat/create-lookup-table-solana-cct-sdk' into feat/DAPP…
mervin-link Jul 14, 2026
4d086cb
fix: SolanaOperation type changes
mervin-link Jul 14, 2026
fc21982
fix: validate authority as public key first
mervin-link Jul 15, 2026
8409c3e
fix: error message
mervin-link Jul 15, 2026
3669920
Merge branch 'feat/create-lookup-table-solana-cct-sdk' into feat/DAPP…
mervin-link Jul 15, 2026
1aab28c
fix: update execute to remove duplicate validation
mervin-link Jul 15, 2026
6aff729
Merge branch 'feat/create-lookup-table-solana-cct-sdk' into feat/DAPP…
mervin-link Jul 15, 2026
657d489
fix: add authority validation on execute
mervin-link Jul 15, 2026
7f77b36
feat(cct-sdk): Add append to lookup table solana op (#293)
mervin-link Jul 16, 2026
5aa72b8
apedrob Jul 16, 2026
7f10ec0
feat(cct-sdk): Init CCT SDK with setPool (EVM+Solana) (#273)
apedrob Jul 17, 2026
91da360
fix: merge conflicts
mervin-link Jul 17, 2026
526c8e7
feat(cct-sdk): Add create and append lookup table solana op (#291)
mervin-link Jul 20, 2026
0f46601
chore(cct-sdk): Gate subtree from public releases (#298)
apedrob Jul 20, 2026
d7bae4d
feat(cct-sdk): Add deploy token solana op (#294)
mervin-link Jul 20, 2026
aea0670
feat(cct-sdk): Add version dispatch + Transfer Ownership (#289)
apedrob Jul 21, 2026
8cfb804
feat(cct-sdk): Deploy CrossChainToken + contract artifacts (#297)
apedrob Jul 21, 2026
d4c6ae3
feat(cct-sdk): Add deploy token pool solana op (#296)
mervin-link Jul 21, 2026
17481c5
feat(cct-sdk): Add create token account (ATA) solana op (#300)
mervin-link Jul 23, 2026
849ed2c
feat(cct-sdk): Add create token multisig solana op (#302)
mervin-link Jul 23, 2026
6281f4b
feat(cct-sdk): Add get token pool state config solana op (#306)
mervin-link Jul 27, 2026
c13878c
feat(cct-sdk): Add deploy evm token pool + version resolution (#307)
apedrob Jul 29, 2026
fa5d12b
Merge branch 'main' into cct-sdk
apedrob Jul 29, 2026
bcec89b
feat(cct-sdk): Deploy Lockbox (#311)
apedrob Jul 29, 2026
229c73e
feat(cct-sdk): Authorize Lockbox Callers (#312)
apedrob Jul 29, 2026
8c8adf9
feat(cct-sdk): Add register token solana op (#310)
mervin-link Jul 30, 2026
10ea705
feat(cct-sdk): Add transfer admin solana op (#313)
mervin-link Jul 30, 2026
1030c86
feat(cct-sdk): Add accept admin solana op (#317)
mervin-link Jul 31, 2026
21d698d
fix(cct-sdk): Refactor solana token-admin-registry ops (#309)
mervin-link Jul 31, 2026
bba984b
feat(cct-sdk): Add deploy verification + unify ops (#316)
apedrob Jul 31, 2026
b8ae71b
feat(cct-sdk): Add get token admin registry config solana op (#318)
mervin-link Aug 4, 2026
fac6e77
feat(cct-sdk): Add get supported tokens solana op (#319)
mervin-link Aug 4, 2026
39af9e8
fix(cct-sdk): Update and refactor solana lifecycle and tests (#321)
mervin-link Aug 6, 2026
1af73ba
feat(cct-sdk): Add configure allowlist solana op (#323)
mervin-link Aug 6, 2026
fe40a9c
feat(cct-sdk): Add remove from allowlist solana op (#329)
mervin-link Aug 6, 2026
2c1f819
feat(cct-sdk): Add EVM getTokenPoolState op + query read class (#322)
apedrob Aug 7, 2026
823f6d1
feat(cct-sdk): Add init chain remote config solana op (#339)
mervin-link Aug 7, 2026
4cb12a6
feat(cct-sdk): Add edit chain remote config solana op (#340)
mervin-link Aug 7, 2026
c9616e4
feat(cct-sdk): Add delete chain remote config solana op (#341)
mervin-link Aug 7, 2026
50d0074
feat(cct-sdk): Add register token evm op (#333)
apedrob Aug 7, 2026
6723474
fix(cct-sdk): Migrate solana ops to use parse (#342)
mervin-link Aug 10, 2026
6ee85dd
feat(cct-sdk): Add transfer admin evm op (#334)
apedrob Aug 10, 2026
14a39fc
feat(cct-sdk): Add set chain rate limit op solana (#344)
mervin-link Aug 10, 2026
ddbe59c
fix(cct-sdk): Refactor parse and validations for old solana ops (#350)
mervin-link Aug 12, 2026
736dd48
feat(cct-sdk): Add apply chain updates op solana (#349)
mervin-link Aug 13, 2026
12ac4b3
fix: merge conflicts
mervin-link Aug 13, 2026
f632868
feat(cct-sdk): Add get token pool remote op solana (#354)
mervin-link Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ ccip-api-ref/docs-api/v1/*
!ccip-api-ref/docs-api/v1/sidebar.d.ts

# Canton CLI config
canton-config.json
canton-config.json

pnpm-lock.yaml
12 changes: 12 additions & 0 deletions ccip-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
"types": "./dist/all-chains.d.ts",
"default": "./dist/all-chains.js"
},
"./cct/evm": {
"types": "./dist/cct/evm/index.d.ts",
"default": "./dist/cct/evm/index.js"
},
"./cct/solana": {
"types": "./dist/cct/solana/index.d.ts",
"default": "./dist/cct/solana/index.js"
},
"./dist/*": "./dist/*",
"./src/*": "./src/*"
},
Expand Down Expand Up @@ -67,6 +75,10 @@
"dependencies": {
"@aptos-labs/ts-sdk": "^6.3.1",
"@coral-xyz/anchor": "^0.29.0",
"@metaplex-foundation/mpl-token-metadata": "3.4.0",
"@metaplex-foundation/umi": "1.5.1",
"@metaplex-foundation/umi-bundle-defaults": "1.5.1",
"@metaplex-foundation/umi-web3js-adapters": "1.5.1",
"@mysten/bcs": "^2.1.0",
"@mysten/sui": "^2.22.0",
"@noble/hashes": "^2.2.0",
Expand Down
233 changes: 233 additions & 0 deletions ccip-sdk/src/cct/errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
/**
* CCT-specific error classes for write operations (validate → encode → submit).
* Shared CCIP errors (`CCIPWalletInvalidError`, etc.) live in `../errors/`.
*
* @packageDocumentation
*/

import { type CCIPErrorOptions, CCIPError, CCIPErrorCode } from '../errors/index.ts'

// Parameter validation

/**
* Thrown before any RPC when operation params fail validation. Permanent.
*
* @example
* ```typescript
* try {
* await cct.setPool({ tokenAddress: 'not-an-address', poolAddress, address, wallet })
* } catch (error) {
* if (error instanceof CCTParamsInvalidError) {
* console.log(`Invalid ${error.context.operation} param "${error.context.param}"`)
* }
* }
* ```
*/
export class CCTParamsInvalidError extends CCIPError {
override readonly name = 'CCTParamsInvalidError'
/** Creates a params-invalid error. */
constructor(operation: string, param: string, reason: string, options?: CCIPErrorOptions) {
super(
CCIPErrorCode.CCT_PARAMS_INVALID,
`Invalid ${operation} parameter "${param}": ${reason}`,
{
...options,
isTransient: false,
context: { ...options?.context, operation, param, reason },
},
)
}
}

// Transaction submission

/**
* Thrown when a CCT write fails before broadcast, the transaction reverts after mining,
* or it mines without the expected effect (e.g. a deployment that produced no contract
* address). Pre-broadcast failures (signing/RPC) may set `isTransient: true` for network
* errors; reverts and post-mining anomalies are permanent and include `context.txHash`.
*
* @example
* ```typescript
* try {
* await cct.setPool({ ...opts, wallet })
* } catch (error) {
* if (error instanceof CCTTxFailedError) {
* console.log(`${error.context.operation} failed: ${error.context.reason}`)
* }
* }
* ```
*/
export class CCTTxFailedError extends CCIPError {
override readonly name = 'CCTTxFailedError'
/** Creates a tx-failed error. */
constructor(operation: string, reason: string, options?: CCIPErrorOptions) {
super(CCIPErrorCode.CCT_TX_FAILED, `${operation} failed: ${reason}`, {
...options,
isTransient: options?.isTransient ?? false,
context: { ...options?.context, operation, reason },
})
}
}

/**
* Thrown when a transaction was broadcast but not confirmed within the timeout.
* Transient — it may still mine; check `context.txHash` before resubmitting.
*
* @example
* ```typescript
* try {
* await cct.setPool({ ...opts, wallet })
* } catch (error) {
* if (error instanceof CCTTxNotConfirmedError) {
* console.log(`Not confirmed (tx ${error.context.txHash}); retry in ${error.retryAfterMs}ms`)
* }
* }
* ```
*/
export class CCTTxNotConfirmedError extends CCIPError {
override readonly name = 'CCTTxNotConfirmedError'
/** Creates a tx-not-confirmed error. */
constructor(operation: string, txHash: string, options?: CCIPErrorOptions) {
super(
CCIPErrorCode.CCT_TX_NOT_CONFIRMED,
`${operation} transaction not confirmed within timeout: ${txHash}`,
{
...options,
isTransient: true,
retryAfterMs: 5000,
context: { ...options?.context, operation, txHash },
},
)
}
}

// Contract version dispatch

/**
* Thrown when the contract at an address is not of the expected type.
*
* @example
* ```typescript
* try {
* await cct.transferOwnership({ poolAddress, newOwner, wallet })
* } catch (error) {
* if (error instanceof CCTContractTypeInvalidError) {
* console.log(`Expected ${error.context.expected} at ${error.context.address}, got "${error.context.actual}"`)
* }
* }
* ```
*/
export class CCTContractTypeInvalidError extends CCIPError {
override readonly name = 'CCTContractTypeInvalidError'
/**
* Creates a contract-type-invalid error. `reason` is appended to the message and kept in
* `context`; pass it when `actual` is a recognized type rejected on its own grounds, so the
* message does not read as "wrong address".
*/
constructor(
address: string,
expected: string,
actual: string,
reason?: string,
options?: CCIPErrorOptions,
) {
super(
CCIPErrorCode.CONTRACT_TYPE_INVALID,
`Expected a ${expected} contract at ${address}, got "${actual}"` +
(reason ? ` — ${reason}` : ''),
{
...options,
isTransient: false,
context: { ...options?.context, address, expected, actual, ...(reason && { reason }) },
},
)
}
}

/**
* Thrown when a contract reports a version string the SDK does not recognize. Permanent.
*
* @example
* ```typescript
* try {
* await cct.transferOwnership({ poolAddress, newOwner, wallet })
* } catch (error) {
* if (error instanceof CCTContractVersionUnsupportedError) {
* console.log(`Unsupported ${error.context.contractType} version: ${error.context.version}`)
* }
* }
* ```
*/
export class CCTContractVersionUnsupportedError extends CCIPError {
override readonly name = 'CCTContractVersionUnsupportedError'
/** Creates a contract-version-unsupported error. */
constructor(contractType: string, version: string, options?: CCIPErrorOptions) {
super(
CCIPErrorCode.CCT_CONTRACT_VERSION_UNSUPPORTED,
`Unsupported ${contractType} version: ${version}`,
{
...options,
isTransient: false,
context: { ...options?.context, contractType, version },
},
)
}
}

/**
* Thrown when no implementation is registered for an operation at or below the contract's
* version (floor-match miss). Permanent for that contract version.
*
* @example
* ```typescript
* try {
* await cct.transferOwnership({ poolAddress, newOwner, wallet })
* } catch (error) {
* if (error instanceof CCTOperationUnsupportedError) {
* console.log(`${error.context.operation} unsupported at version ${error.context.version}`)
* }
* }
* ```
*/
export class CCTOperationUnsupportedError extends CCIPError {
override readonly name = 'CCTOperationUnsupportedError'
/** Creates an operation-unsupported error. */
constructor(operation: string, version: string, options?: CCIPErrorOptions) {
super(
CCIPErrorCode.CCT_OPERATION_UNSUPPORTED,
`${operation} is not supported at contract version ${version}`,
{
...options,
isTransient: false,
context: { ...options?.context, operation, version },
},
)
}
}

/**
* Thrown when CCT account data cannot be decoded.
*
* @example
* ```typescript
* try {
* await cct.getTokenPoolState({ tokenAddress: mint, poolType: 'burn-mint' })
* } catch (error) {
* if (error instanceof CCTDataDecodeError) {
* console.log(error.message)
* }
* }
* ```
*/
export class CCTDataDecodeError extends CCIPError {
override readonly name = 'CCTDataDecodeError'
/** Creates a CCT data decode error. */
constructor(account: string, options?: CCIPErrorOptions) {
super(CCIPErrorCode.CCT_DATA_DECODE_FAILED, `Unable to decode CCT data at ${account}`, {
...options,
isTransient: false,
context: { ...options?.context, account },
})
}
}
Loading
Loading