Skip to main content
Version: 1.16.1

Variable: discoverOffRamp

const discoverOffRamp: Memoized<(source: Chain, dest: Chain, __namedParameters: Pick<Lane, "onRamp" | "version">, __namedParameters: WithLogger) => Promise<string>, { async: true; maxSize: number; transformKey: (__namedParameters: [source: Chain<ChainFamily>, dest: Chain<ChainFamily>, Pick<Lane<CCIPVersion>, "onRamp" | "version">, WithLogger?]) => [bigint, bigint, string, CCIPVersion]; }>

Defined in: execution.ts:125

Discover the OffRamp address for a given lane (OnRamp and protocol version) on a destination chain. Results are memoized for performance.

Remarks​

One OnRamp can serve more than one lane version to the same destination. For example, a Solana 2.0 Router (which is also the OnRamp) keeps its 1.6 entrypoint next to the 2.0 one, and the destination has a 1.6 OffRamp and a 2.0 OffRamp that both accept that Router. The lane version selects between them: a 2.0 lane gives a 2.0 OffRamp, and a pre-2.0 lane gives a pre-2.0 OffRamp. Use request.lane for a sent message: its version comes from the message shape.

Param​

source

Source chain instance.

Param​

dest

Destination chain instance.

Param​

lane

Lane to discover the OffRamp for: onRamp (OnRamp address on source chain) and version (CCIP protocol version of the lane, e.g. request.lane.version).

Param​

ctx

Optional context with logger.

Returns​

OffRamp address on destination chain.

Throws​

CCIPOffRampNotFoundError - When no OffRamp of the lane's version accepts the OnRamp

Example​

TypeScript
import { discoverOffRamp, EVMChain } from '@chainlink/ccip-sdk'

const source = await EVMChain.fromUrl('https://rpc.sepolia.org')
const dest = await EVMChain.fromUrl('https://rpc.fuji.avax.network')

const [request] = await source.getMessagesInTx(txHash)
const offRamp = await discoverOffRamp(source, dest, request.lane)
console.log('OffRamp on destination:', offRamp)

See​

  • calculateManualExecProof - Use with OffRamp for manual execution
  • execute - Execute on destination chain
  • getExecutionReceipts - Check execution status