Skandha Bundler
Batch RPC calls
With Skandha we have the ability to batch rpc calls together.
An example of this in a node script:
const returnedValue = await fetch('https://polygon-bundler.etherspot.io/', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
// Batch together multiple calls like so
body: JSON.stringify([
{ "method": "skandha_config" },
{ "method": "eth_chainId" },
{ "method": "eth_supportedEntryPoints" },
{ "method": "skandha_feeHistory",
"params": [
"0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789",
"15",
"latest"
]}])
})
.then((res) => {
return res.json()
}).catch((err) => {
console.log(err);
// throw new Error(JSON.stringify(err.response))
});
console.log('Value returned: ', returnedValue);
Here we’re batching skandha_config, eth_chainId, eth_supportedEntryPoints and skandha_feeHistory together. You can do this with any of amount of requests but a limit will be enabled in the future.
The response will look like this:
Value returned: [
{
result: {
chainId: 137,
flags: [Object],
entryPoints: [Array],
beneficiary: '0xdCdD0DDEaA0407C26DFcD481De9A34e1C55F8d54',
relayer: '0xdCdD0DDEaA0407C26DFcD481De9A34e1C55F8d54',
minInclusionDenominator: 10,
throttlingSlack: 10,
banSlack: 10,
minSignerBalance: '0.1 eth',
multicall: '0xcA11bde05977b3631167028862bE2a173976CA11',
estimationStaticBuffer: 35000,
validationGasLimit: 10000000,
receiptLookupRange: 1024,
etherscanApiKey: false,
conditionalTransactions: false,
rpcEndpointSubmit: false,
gasPriceMarkup: 2000,
enforceGasPrice: false,
enforceGasPriceThreshold: 1000,
eip2930: false
}
},
{ result: '0x89' },
{ result: [ '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789' ] },
{
result: {
actualGasPrice: [Array],
maxFeePerGas: [Array],
maxPriorityFeePerGas: [Array]
}
}
]