Skip to content
2 changes: 1 addition & 1 deletion ccip-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Format } from './commands/index.ts'
util.inspect.defaultOptions.depth = 6 // print down to tokenAmounts in requests
// generate:nofail
// `const VERSION = '${require('./package.json').version}-${require('child_process').execSync('git rev-parse --short HEAD').toString().trim()}'`
const VERSION = '1.0.0-0c096d1'
const VERSION = '1.0.0-de8f90f'
// generate:end

const globalOpts = {
Expand Down
2 changes: 1 addition & 1 deletion ccip-sdk/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const DEFAULT_TIMEOUT_MS = 30000
/** SDK version string for telemetry header */
// generate:nofail
// `export const SDK_VERSION = '${require('./package.json').version}-${require('child_process').execSync('git rev-parse --short HEAD').toString().trim()}'`
export const SDK_VERSION = '1.0.0-0c096d1'
export const SDK_VERSION = '1.0.0-de8f90f'
// generate:end

/** SDK telemetry header name */
Expand Down
54 changes: 54 additions & 0 deletions ccip-sdk/src/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
CCIPApiClientNotAvailableError,
CCIPChainFamilyMismatchError,
CCIPExecTxRevertedError,
CCIPNotImplementedError,
CCIPTokenPoolChainConfigNotFoundError,
CCIPTransactionNotFinalizedError,
} from './errors/index.ts'
Expand Down Expand Up @@ -173,6 +174,29 @@ export type TokenInfo = {
readonly name?: string
}

/**
* Available lane feature keys.
* These represent features or thresholds that can be configured per-lane.
*/
export const LaneFeature = {
/**
* Minimum block confirmations required for Faster Time to Finality (FTF).
* When present and non-zero, indicates FTF is enabled on this lane.
*/
MIN_BLOCK_CONFIRMATIONS: 'MIN_BLOCK_CONFIRMATIONS',
} as const
/** Type representing one of the lane feature keys. */
export type LaneFeature = (typeof LaneFeature)[keyof typeof LaneFeature]

/**
* Lane features record.
* Maps feature keys to their values.
*/
export interface LaneFeatures extends Record<LaneFeature, unknown> {
/** Minimum block confirmations for FTF. */
MIN_BLOCK_CONFIRMATIONS: number
}

/**
* Options for getBalance query.
*/
Expand Down Expand Up @@ -1050,6 +1074,36 @@ export abstract class Chain<F extends ChainFamily = ChainFamily> {
return this.apiClient.getLaneLatency(this.network.chainSelector, destChainSelector)
}

/**
* Retrieve features for a lane (router/destChainSelector/token triplet).
*
* @param _opts - Options containing router address, destChainSelector, and optional token
* address (the token to be transferred in a hypothetical message on this lane)
* @returns Promise resolving to partial lane features record
*
* @throws {@link CCIPNotImplementedError} if not implemented for this chain family
*
* @example Get lane features
* ```typescript
* const features = await chain.getLaneFeatures({
* router: '0x...',
* destChainSelector: 4949039107694359620n,
* })
* // FTF is enabled when MIN_BLOCK_CONFIRMATIONS is defined and > 0.
* // A value of 0 means FTF is disabled for this lane.
* if (features.MIN_BLOCK_CONFIRMATIONS != null && features.MIN_BLOCK_CONFIRMATIONS > 0) {
* console.log(`FTF enabled with ${features.MIN_BLOCK_CONFIRMATIONS} confirmations`)
* }
* ```
*/
getLaneFeatures(_opts: {
router: string
destChainSelector: bigint
token?: string
}): Promise<Partial<LaneFeatures>> {
return Promise.reject(new CCIPNotImplementedError('getLaneFeatures'))
}

/**
* Default/generic implementation of getExecutionReceipts.
* Yields execution receipts for a given offRamp.
Expand Down
Loading
Loading