apibara / starknet-react

A collection of React providers and hooks for StarkNet
https://starknet-react.com
MIT License
369 stars 147 forks source link

batch calls via multicall #291

Closed moodysalem closed 8 months ago

moodysalem commented 1 year ago

sending 1 rpc per call can lead to getting throttled

instead, batch the calls into a rpc that calls a contract that allows you to call many other contracts and returns all the data in an array of structs

fracek commented 1 year ago

Agree. Let's see if we can add it to starknet react or maybe it needs to be part of starknet.js (like viem).

Or do you mean to create and deploy a multicall contract and use that to batch calls?

moodysalem commented 1 year ago

Agree. Let's see if we can add it to starknet react or maybe it needs to be part of starknet.js (like viem).

Or do you mean to create and deploy a multicall contract and use that to batch calls?

yeah a multicall contract would be good iff there is no way to send a batch json rpc call

the only other reason multicall is useful is because infura counts per request for billing, rather than for complexity of the request, so making one big multicall is cheaper than many smaller calls

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had activity in the six months. It will be closed in 2 weeks if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant.

github-actions[bot] commented 8 months ago

This issue has been automatically closed because it has not had any further activity in the last 14 days.