Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
Planned Implementation
Send Message
OFT (Omnichain Fungible Token)
Message Tracking
Resources
Related
- chainlink — CCIP alternative
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Cross-chain messaging with LayerZero
import { LayerZero } from './LayerZero.js';
const lz = LayerZero({
provider,
endpoint: LZ_ENDPOINT,
});
// Estimate fee
const fee = await lz.quote({
dstEid: ARBITRUM_EID,
message: encodedPayload,
options: defaultOptions,
});
// Send message
await lz.send({
dstEid: ARBITRUM_EID,
message: encodedPayload,
options: defaultOptions,
fee,
signer,
});
// Send tokens cross-chain
await lz.sendOFT({
oft: OFT_ADDRESS,
dstEid: OPTIMISM_EID,
to: recipientAddress,
amount: parseEther('100'),
signer,
});
// Get message status by GUID
const status = await lz.getMessageStatus(guid);
// 'INFLIGHT' | 'DELIVERED' | 'FAILED'
Was this page helpful?
