
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@pancakeswap/multicall
Advanced tools
Enhanced multicall sdk to safely make multicalls within the gas limit.
Enhanced multicall sdk to safely make multicalls within the gas limit.
Inspired by the 1inch multicall.
$ pnpm add @pancakeswap/multicall @pancakeswap/sdk viem
By default the calls will be splitted into chunks based on gas limit of each call and the rpc call gas limit of the chain
import { ChainId } from '@pancakeswap/chains'
import { multicallByGasLimit, MulticallRequestWithGas } from '@pancakeswap/multicall'
const calls: MulticallRequestWithGas[] = [
{
// Target contract to call
target: '0x',
// Encoded call data
callData: '',
// The maximum gas limit set to this single call
gasLimit: 1_000_000,
},
]
const { results, blockNumber } = await multicallByGasLimit(calls, {
chainId: ChainId.BSC,
// Rpc client. Please refer to `PublicClient` from viem
client,
})
for (const { success, result, gasUsed } of results) {
if (success) {
// Decode result
decodeResult(result)
}
}
The rpc call gas limit can be overriden if provided. Once provided, the multicall sdk won't ask for the gas limit from on chain.
const { results, blockNumber } = await multicallByGasLimit(calls, {
chainId: ChainId.BSC,
client,
gasLimit: 150_000_000,
})
import { ChainId } from '@pancakeswap/chains'
import { getGasLimitOnChain } from '@pancakeswap/multicall'
// Get the rpc call gas limit of the specified chain
const gasLimit = await getGasLimitOnChain(ChainId.BSC)
For supported chains and contract addresses, please refer to multicall contracts.
FAQs
Enhanced multicall sdk to safely make multicalls within the gas limit.
The npm package @pancakeswap/multicall receives a total of 2,461 weekly downloads. As such, @pancakeswap/multicall popularity was classified as popular.
We found that @pancakeswap/multicall demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.