Understanding the fundamental concepts behind Magic Router SDK
getBlockhashForAccounts
method to:
getLatestBlockhash()
call may result in transaction failures if your accounts are delegated to an Ephemeral Rollup, as the blockhash progression differs between layers.getClosestValidator
function optimizes transaction performance by:
getClosestValidator
to automatically select the best one for your users. Here is an example of a contract and frontend following this flow.
Automatic Validator Selection
getClosestValidator()
ensures optimal performance by automatically selecting the geographically closest and least loaded validator for your users.Batch Delegation
postInstructions()
, reducing transaction costs and setup time.Flexible Commit Frequency
commitFrequencyMs
parameter allows you to balance between performance (lower frequency) and data persistence guarantees (higher frequency).