Function: encodeExtraArgs()
encodeExtraArgs(
args:ExtraArgs,from:ChainFamily):string
Defined in: extra-args.ts:167
Encodes extra arguments for CCIP messages. The args are to a dest network, but are encoded as a message from this source chain. E.g. Solana uses Borsh to encode extraArgs in its produced requests, even those targeting EVM.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
args | ExtraArgs | undefined | Extra arguments to encode |
from | ChainFamily | ChainFamily.EVM | Source chain family for encoding format (defaults to EVM) |
Returns
string
Encoded extra arguments as hex string
Throws
CCIPChainFamilyUnsupportedError if chain family not supported
Example
TypeScript
import { encodeExtraArgs } from '@chainlink/ccip-sdk'
const encoded = encodeExtraArgs({
gasLimit: 200_000n,
allowOutOfOrderExecution: true,
})
console.log('Encoded:', encoded) // '0x181dcf10...'
See
decodeExtraArgs - Decode extra arguments from bytes