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.
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
registerOapp(payer: Signer, oapp: Signer, oappRegistry: AccountInfo, systemProgram: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, delegate: Pubkey)
initNonce() - Initialize Nonce
initNonce(delegate: Signer, oappRegistry: AccountInfo, nonce: AccountInfo, pendingInboundNonce: AccountInfo, systemProgram: AccountInfo, localOapp: Pubkey, remoteEid: u32, remoteOapp: bytes32)
Message Operations
quote() - Get Fee Estimates
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
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
initVerify(payer: Signer, nonce: AccountInfo, payloadHash: AccountInfo, systemProgram: AccountInfo, srcEid: u32, sender: bytes32, receiver: Pubkey, nonce: u64)
verify() - Verify Inbound Message
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
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
clearCompose(to: Signer, composeMessage: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, from: Pubkey, guid: bytes32, index: u16, message: bytes)
Message Recovery & Security
skip() - Skip Inbound Nonce
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
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
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
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
initSendLibrary(delegate: Signer, oappRegistry: AccountInfo, sendLibraryConfig: AccountInfo, systemProgram: AccountInfo, sender: Pubkey, eid: u32)
setSendLibrary() - Set Send Library
setSendLibrary(signer: Signer, oappRegistry: AccountInfo, sendLibraryConfig: AccountInfo, messageLibInfo: AccountInfo?, eventAuthority: AccountInfo, program: AccountInfo, sender: Pubkey, eid: u32, newLib: Pubkey)
initReceiveLibrary() - Initialize Receive Library
initReceiveLibrary(delegate: Signer, oappRegistry: AccountInfo, receiveLibraryConfig: AccountInfo, systemProgram: AccountInfo, receiver: Pubkey, eid: u32)
setReceiveLibrary() - Set Receive Library
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
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
initConfig(delegate: Signer, oappRegistry: AccountInfo, messageLibInfo: AccountInfo, messageLib: AccountInfo, messageLibProgram: AccountInfo, oapp: Pubkey, eid: u32)
setConfig() - Set Configuration
setConfig(signer: Signer, oappRegistry: AccountInfo, messageLibInfo: AccountInfo, messageLib: AccountInfo, messageLibProgram: AccountInfo, oapp: Pubkey, eid: u32, configType: u32, config: bytes)
setDelegate() - Set Delegate
setDelegate(oapp: Signer, oappRegistry: AccountInfo, eventAuthority: AccountInfo, program: AccountInfo, delegate: Pubkey)
Admin Functions
withdrawRent() - Withdraw Rent
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.
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
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
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
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
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
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
lzReceiveTypes(oftStore: AccountInfo, tokenMint: AccountInfo, srcEid: u32, sender: bytes32, nonce: u64, guid: bytes32, message: bytes, extraData: bytes)
Token Information
oftVersion() - Get OFT Version
oftVersion()
Configuration
setPeerConfig() - Configure Remote Peer
setPeerConfig(admin: Signer, peer: AccountInfo, oftStore: AccountInfo, systemProgram: AccountInfo, remoteEid: u32, configType: u8, configData: bytes)
setOftConfig() - Update OFT Settings
setOftConfig(admin: Signer, oftStore: AccountInfo, configType: u8, configData: bytes)
setPause() - Pause/Unpause OFT
setPause(signer: Signer, oftStore: AccountInfo, paused: bool)
withdrawFee() - Withdraw Collected Fees
withdrawFee(admin: Signer, oftStore: AccountInfo, tokenMint: AccountInfo, tokenEscrow: AccountInfo, tokenDest: AccountInfo, tokenProgram: AccountInfo, feeLd: u64)
Usage Tips
Getting Started
- Connect Your Wallet: Click "Connect Phantom Wallet" to connect your Solana wallet
- Select Network: Choose between Solana Mainnet and Devnet
- Custom RPC (Optional): If you encounter rate limits (403 errors), add a custom RPC URL:
Common Workflows
Sending Tokens Cross-Chain (OFT)
- Initialize your OFT with
initOft()
- Configure peers with
setPeerConfig()
- Get a quote with
quoteOft()
orquoteSend()
- Send tokens with
send()
Setting Up Messaging (Endpoint)
- Register your OApp with
registerOapp()
- Initialize nonce tracking with
initNonce()
- Set up libraries with
initSendLibrary()
andinitReceiveLibrary()
- Configure DVNs/executors with
setConfig()
- Get quotes with
quote()
and send messages withsend()
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.