Skip to main content
Version: Endpoint V2

Interactive Solana Instructions Playground

Test LayerZero Solana programs directly from your browser. Build and send instructions without writing code. Explore key program instructions for message fee calculation, sending, receiving, and configuration management.

Experimental Feature

This playground is experimental and uses simplified instruction encoding. For production use, please use the official LayerZero Solana SDK which provides proper type-safe instruction builders.

Current Limitations:

  • Instruction data encoding is simplified and may not match the exact format expected by the programs
  • Some complex instructions may require specific account ordering or additional accounts not shown here
  • The actual instruction discriminators and data encoding may differ from what's shown here
  • Simulations may fail with "InvalidAccountForFee" or other errors - this is expected as the playground uses experimental encoding

For accurate interaction with LayerZero programs, please use the official SDKs:

LayerZero Endpoint Program

The main entry point for all cross-chain messaging operations on Solana. This program handles message routing, fee calculation, and configuration management.

OApp Registration & Setup

registerOapp() - Register OApp

WRITE
registerOapp(payer: Signer, oapp: Signer, oappRegistry: AccountInfo, systemProgram: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, delegate: Pubkey)

initNonce() - Initialize Nonce

WRITE
initNonce(delegate: Signer, oappRegistry: AccountInfo, nonce: AccountInfo, pendingInboundNonce: AccountInfo, systemProgram: AccountInfo, localOapp: Pubkey, remoteEid: u32, remoteOapp: bytes32)

Message Operations

quote() - Get Fee Estimates

READ
quote(sendLibraryProgram: AccountInfo, sendLibraryConfig: AccountInfo, defaultSendLibraryConfig: AccountInfo, sendLibraryInfo: AccountInfo, endpoint: AccountInfo, nonce: AccountInfo, sender: Pubkey, dstEid: u32, receiver: bytes32, message: bytes, options: bytes, payInLzToken: bool)

send() - Send Cross-Chain Message

WRITE
send(sender: Signer, sendLibraryProgram: AccountInfo, sendLibraryConfig: AccountInfo, defaultSendLibraryConfig: AccountInfo, sendLibraryInfo: AccountInfo, endpoint: AccountInfo, nonce: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, dstEid: u32, receiver: bytes32, message: bytes, options: bytes, nativeFee: u64, lzTokenFee: u64)

Message Verification

initVerify() - Initialize Verification

WRITE
initVerify(payer: Signer, nonce: AccountInfo, payloadHash: AccountInfo, systemProgram: AccountInfo, srcEid: u32, sender: bytes32, receiver: Pubkey, nonce: u64)

verify() - Verify Inbound Message

WRITE
verify(receiveLibrary: Signer, receiveLibraryConfig: AccountInfo, defaultReceiveLibraryConfig: AccountInfo, nonce: AccountInfo, pendingInboundNonce: AccountInfo, payloadHash: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, srcEid: u32, sender: bytes32, receiver: Pubkey, nonce: u64, payloadHash: bytes32)

Compose Messages

sendCompose() - Send Compose Message

WRITE
sendCompose(from: Signer, payer: Signer, composeMessage: AccountInfo, systemProgram: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, to: Pubkey, guid: bytes32, index: u16, message: bytes)

clearCompose() - Clear Compose Message

WRITE
clearCompose(to: Signer, composeMessage: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, from: Pubkey, guid: bytes32, index: u16, message: bytes)

Message Recovery & Security

skip() - Skip Inbound Nonce

WRITE
skip(signer: Signer, oappRegistry: AccountInfo, nonce: AccountInfo, pendingInboundNonce: AccountInfo, payloadHash: AccountInfo, endpoint: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, receiver: Pubkey, srcEid: u32, sender: bytes32, nonce: u64)

burn() - Permanently Block Message

WRITE
burn(signer: Signer, oappRegistry: AccountInfo, nonce: AccountInfo, payloadHash: AccountInfo, endpoint: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, receiver: Pubkey, srcEid: u32, sender: bytes32, nonce: u64, payloadHash: bytes32)

nilify() - Mark Message as Nil

WRITE
nilify(signer: Signer, oappRegistry: AccountInfo, nonce: AccountInfo, pendingInboundNonce: AccountInfo, payloadHash: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, receiver: Pubkey, srcEid: u32, sender: bytes32, nonce: u64, payloadHash: bytes32)

clear() - Clear Payload

WRITE
clear(signer: Signer, oappRegistry: AccountInfo, nonce: AccountInfo, payloadHash: AccountInfo, endpoint: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, receiver: Pubkey, srcEid: u32, sender: bytes32, nonce: u64, guid: bytes32, message: bytes)

Library Configuration

initSendLibrary() - Initialize Send Library

WRITE
initSendLibrary(delegate: Signer, oappRegistry: AccountInfo, sendLibraryConfig: AccountInfo, systemProgram: AccountInfo, sender: Pubkey, eid: u32)

setSendLibrary() - Set Send Library

WRITE
setSendLibrary(signer: Signer, oappRegistry: AccountInfo, sendLibraryConfig: AccountInfo, messageLibInfo: AccountInfo?, eventAuthority: AccountInfo, program: AccountInfo, sender: Pubkey, eid: u32, newLib: Pubkey)

initReceiveLibrary() - Initialize Receive Library

WRITE
initReceiveLibrary(delegate: Signer, oappRegistry: AccountInfo, receiveLibraryConfig: AccountInfo, systemProgram: AccountInfo, receiver: Pubkey, eid: u32)

setReceiveLibrary() - Set Receive Library

WRITE
setReceiveLibrary(signer: Signer, oappRegistry: AccountInfo, receiveLibraryConfig: AccountInfo, messageLibInfo: AccountInfo?, eventAuthority: AccountInfo, program: AccountInfo, receiver: Pubkey, eid: u32, newLib: Pubkey, gracePeriod: u64)

setReceiveLibraryTimeout() - Set Library Timeout

WRITE
setReceiveLibraryTimeout(signer: Signer, oappRegistry: AccountInfo, receiveLibraryConfig: AccountInfo, messageLibInfo: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, receiver: Pubkey, eid: u32, lib: Pubkey, expiry: u64)

Configuration Management

initConfig() - Initialize Configuration

WRITE
initConfig(delegate: Signer, oappRegistry: AccountInfo, messageLibInfo: AccountInfo, messageLib: AccountInfo, messageLibProgram: AccountInfo, oapp: Pubkey, eid: u32)

setConfig() - Set Configuration

WRITE
setConfig(signer: Signer, oappRegistry: AccountInfo, messageLibInfo: AccountInfo, messageLib: AccountInfo, messageLibProgram: AccountInfo, oapp: Pubkey, eid: u32, configType: u32, config: bytes)

setDelegate() - Set Delegate

WRITE
setDelegate(oapp: Signer, oappRegistry: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, delegate: Pubkey)

Admin Functions

withdrawRent() - Withdraw Rent

WRITE
withdrawRent(admin: Signer, endpoint: AccountInfo, receiver: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, amount: u64)

LayerZero OFT Program

Omnichain Fungible Token (OFT) enables seamless cross-chain token transfers. Deploy once and bridge your SPL tokens to any supported blockchain.

tip

If your OFT program hasn't been deployed to a specific network, you can supply a custom program ID in the input field.

Token Setup

initOft() - Initialize OFT

WRITE
initOft(payer: Signer, oftStore: AccountInfo, lzReceiveTypesAccounts: AccountInfo, tokenMint: AccountInfo, tokenEscrow: Signer, tokenProgram: AccountInfo, systemProgram: AccountInfo, oftType: u8, admin: Pubkey, sharedDecimals: u8, endpointProgram: Pubkey?)

Cross-Chain Operations

quoteOft() - Get OFT Quote

READ
quoteOft(oftStore: AccountInfo, peer: AccountInfo, tokenMint: AccountInfo, dstEid: u32, to: bytes32, amountLd: u64, minAmountLd: u64, options: bytes, composeMsg: bytes?, payInLzToken: bool)

quoteSend() - Get Send Quote

READ
quoteSend(oftStore: AccountInfo, peer: AccountInfo, tokenMint: AccountInfo, dstEid: u32, to: bytes32, amountLd: u64, minAmountLd: u64, options: bytes, composeMsg: bytes?, payInLzToken: bool)

send() - Send Tokens Cross-Chain

WRITE
send(signer: Signer, peer: AccountInfo, oftStore: AccountInfo, tokenSource: AccountInfo, tokenEscrow: AccountInfo, tokenMint: AccountInfo, tokenProgram: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, dstEid: u32, to: bytes32, amountLd: u64, minAmountLd: u64, options: bytes, composeMsg: bytes?, nativeFee: u64, lzTokenFee: u64)

lzReceive() - Receive Tokens

WRITE
lzReceive(payer: Signer, peer: AccountInfo, oftStore: AccountInfo, tokenEscrow: AccountInfo, toAddress: AccountInfo, tokenDest: AccountInfo, tokenMint: AccountInfo, mintAuthority: AccountInfo?, tokenProgram: AccountInfo, associatedTokenProgram: AccountInfo, systemProgram: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, srcEid: u32, sender: bytes32, nonce: u64, guid: bytes32, message: bytes, extraData: bytes)

lzReceiveTypes() - Get Receive Account Types

READ
lzReceiveTypes(oftStore: AccountInfo, tokenMint: AccountInfo, srcEid: u32, sender: bytes32, nonce: u64, guid: bytes32, message: bytes, extraData: bytes)

Token Information

oftVersion() - Get OFT Version

READ
oftVersion()

Configuration

setPeerConfig() - Configure Remote Peer

WRITE
setPeerConfig(admin: Signer, peer: AccountInfo, oftStore: AccountInfo, systemProgram: AccountInfo, remoteEid: u32, configType: u8, configData: bytes)

setOftConfig() - Update OFT Settings

WRITE
setOftConfig(admin: Signer, oftStore: AccountInfo, configType: u8, configData: bytes)

setPause() - Pause/Unpause OFT

WRITE
setPause(signer: Signer, oftStore: AccountInfo, paused: bool)

withdrawFee() - Withdraw Collected Fees

WRITE
withdrawFee(admin: Signer, oftStore: AccountInfo, tokenMint: AccountInfo, tokenEscrow: AccountInfo, tokenDest: AccountInfo, tokenProgram: AccountInfo, feeLd: u64)

Usage Tips

Getting Started

  1. Connect Your Wallet: Click "Connect Phantom Wallet" to connect your Solana wallet
  2. Select Network: Choose between Solana Mainnet and Devnet
  3. Custom RPC (Optional): If you encounter rate limits (403 errors), add a custom RPC URL:

Common Workflows

Sending Tokens Cross-Chain (OFT)

  1. Initialize your OFT with initOft()
  2. Configure peers with setPeerConfig()
  3. Get a quote with quoteOft() or quoteSend()
  4. Send tokens with send()

Setting Up Messaging (Endpoint)

  1. Register your OApp with registerOapp()
  2. Initialize nonce tracking with initNonce()
  3. Set up libraries with initSendLibrary() and initReceiveLibrary()
  4. Configure DVNs/executors with setConfig()
  5. Get quotes with quote() and send messages with send()

Troubleshooting

  • 403 Errors: Use a custom RPC URL instead of public endpoints
  • "Account does not exist": Ensure all required accounts have been initialized
  • "Invalid arguments": Check that byte arrays are properly formatted (0x prefix)
  • Simulation failures: This playground uses simplified encoding - use official SDKs for production

For production applications, always use the official LayerZero SDKs which provide proper type safety and encoding.