API Reference

Complete technical reference for InterLayer's JSON-RPC API, runtime pallets, and error codes.

JSON-RPC Methods

Chain Methods

chain_getBlock

Get block details by hash or number

// Request
POST /rpc
{"jsonrpc": "2.0", "method": "chain_getBlock", "params": ["0xABC..."], "id": 1}
// Response
{"jsonrpc": "2.0", "result": {"block": {...}, "justifications": null}, "id": 1}

chain_getHeader

Get block header by hash

{"jsonrpc": "2.0", "method": "chain_getHeader", "params": [], "id": 1}
// Returns latest header if params empty

chain_getFinalizedHead

Get hash of the last finalized block

{"jsonrpc": "2.0", "method": "chain_getFinalizedHead", "params": [], "id": 1}

MEL Custom Methods

mel_submitCrossVmTx

Submit an atomic MEL-enveloped cross-VM transaction payload directly to the Unified Matrix.

// Request Example
{
"jsonrpc": "2.0",
"method": "mel_submitCrossVmTx",
"params": {
"from": [4, 112, 235, ...],
"to": [21, 95, 12, ...],
"vm": { "EVM": null },
"payload": [248, 110, 130, ...],
"gas_budget": 21000,
"nonce": 1717234399000,
"chain_id": 2021,
"auth_scheme": { "Native": null }
}
}
Authentication Schemes: Matches Ecdsa, Ed25519, Sr25519, or Native (delegating verification directly to the internal VM signature decoder).

mel_getVmState

Query VM-specific state

{"method": "mel_getVmState", "params": {"vm": "EVM", "address": "0x..."}}

mel_estimateGas

Estimate unified gas for cross-VM call

{"method": "mel_estimateGas", "params": [...]}
// Returns gas in unified units

State Methods

state_getStorage

Query chain state by storage key

{"method": "state_getStorage", "params": ["0x26aa394eea5630e07c48ae0c9558cef7"]}

state_getMetadata

Get runtime metadata

{"method": "state_getMetadata", "params": []}

Runtime Pallets

InterLayer ships with 35+ runtime pallets across governance, execution, bridging, DeFi, liquidity, and security. Fees are routed 80% to validators/delegators, 10% to LiteVerse reward pools, and the remainder to treasury.

PalletCategoryPurpose
mel-core / mel-busMELMulti-VM scheduler, atomic bundles, routing
mel-evm / mel-svm / mel-move / mel-cosmwasm / mel-polkavmMELPer-VM adapter API for execution
fee-distributionEconomicsOn-chain fee splitter (80% validators / 10% LiteVerse / 10% treasury)
delegated-stakingStakingValidators, self-bond, delegations, unbonding, eras, commission
hotstuff-consensus / hotstuff-session / block-timingConsensusHotStuff BFT, authority sets, 100ms slots
pallet-handlesIdentityHuman-readable usernames + cross-chain mapping
pallet-smart-accountsIdentityExternal wallet binding and execution nonces
pallet-unified-balanceCoreShared balance ledger for atomic cross-VM execution
pallet-interlayer-tokenEconomicsNative IL asset issuance and transfers
pallet-interlayer-native-assetsBridgingMPC-backed deposit addresses, withdrawal batching
bridge-pallet / settlement / dex / registryDeFiShadow bridge, swaps, token registry
multi-vm-governanceGovernancePer-VM council tracks and proposal lifecycle
governance / treasury-liquidity / agentGovernanceCouncil votes, treasury ops, agent hooks
mev-protection / mev-controlsSecurityMEV guards and ordering controls
quantum-signatures / pq-signaturesSecurityPost-quantum / quantum-resistant signature pallets
zk-verificationSecurityOn-chain ZK proof verification primitives
atomic-executionExecutionAtomic transaction execution guarantees
liteverse-palletLite ClientsWatch tasks, rewards for BTC/SOL/ETH watchers
faucetInfraRate-limited testnet tokens, store-eviction-safe history
gas-sponsorship / payment-channelsInfraSponsored gas and payment channel support
monitoring / slashing / session-managementInfraValidator monitoring, slashing, session handover
rate-limit / dynamic-blocks / data-availability-hooksConsensusRate limits, dynamic block sizing, bridge DA hooks
interoperabilityBridgingCross-chain interoperability primitives
feesEconomicsFee calculation and routing primitives
validator-set / staking-reward-payoutStakingValidator set management and reward payout

Runtime APIs Included in the Node

The InterLayer node exposes more than a generic Substrate runtime API set. These custom APIs are accessed via the node RPC layer and power the portal, explorer, SDKs, and wallet integrations.

APILayerKey Capabilities
MelEvmApi / MelSvmApi / MelMoveApi / MelCosmApi / MelPolkaVmApi / MelUnifiedApiMELPer-VM dry-run, execution, estimate gas, balance/nonce/code/storage queries, unified account lookup
LiteverseApiLite ClientsWatch address management, available bridge tasks, watcher rewards
HandlesApiIdentityResolve handles, reverse lookup handles, availability checks
UnifiedAddressApiIdentityResolve per-VM addresses from a handle, reverse resolve VM address to handle
FaucetApiInfraAddress resolution, balance lookup, last request timestamps, request counts, total distributed
SmartAccountsApiSecurityVM account mapping, bound wallet enumeration, execution/binding nonces
PortalApiPortalAccount overview, supported wallet types, validator list, network/staking/portfolio/governance overviews, governance proposals
StakingApiStakingStaking config, current era, overview, validator views, account views
GasSponsorshipApiInfraSponsor deposit balance, gas budget, gas used, active status, user allowlists
HotStuffApiConsensusCurrent validator authorities, current slot, current view/epoch

Error Codes

NonceTooLow

Code: 2001

Transaction nonce incorrect

Solution:
Use correct account nonce

InsufficientBalance

Code: 2002

Account balance too low to cover fees

Solution:
Fund account or reduce transfer amount

VmTypeNotSupported

Code: 2003

Requested VM type is not active

Solution:
Use EVM, SVM, PolkaVM, Move, or CosmWasm

SvmAccountNotFound

Code: 2004

SVM account not yet initialized

Solution:
Initialize the account by transferring lamports via svm_airdrop

GasSponsorshipInvalid

Code: 2005

Sponsor is inactive or user not allowlisted

Solution:
Check sponsor status and user allowlist

AtomicExecutionFailed

Code: 2006

One or more calls in an atomic bundle reverted

Solution:
Check individual VM receipts in receipt.vm_error

HandleUnavailable

Code: 3000

Requested handle/username is taken

Solution:
Choose an alternative handle

StakingCandidateNotActive

Code: 4000

Validator candidate is not in Active status

Solution:
Wait for candidate activation or pick another candidate

WebSocket Subscriptions

chain_subscribeNewHeads

Subscribe to new block headers

const
unsubscribe = await api.rpc.chain.subscribeNewHeads((header) => {
console.log(`New block #${header.number}`);
});

state_subscribeStorage

Subscribe to storage changes

api.rpc.state.subscribeStorage([key], (changes) => { ... })