Describe the Feature
FallbackProvider doesn't allow sending a request that has a custom method, ex: alchemy_getTokenBalances. We need a way to do that similar to the send function in JsonRpcProvider
Code Example
const provider = new FallbackProvider(...args)
const tokenBalances = await provider.send(`alchemy_getTokenBalances`)
// OR
const tokenBalances = await provider.getTokenBalances()
// OR allows sub-class to override _perform logic,
// currently impossible due to error throw in #checkQuorum
class CustomFallbackProvider extends FallbackProvider {
_translatePerform(
provider: CustomJsonRpcProvider,
req: CustomPerformActionRequest,
): Promise<any> {
switch (req.method) {
case 'getTokenBalances':
return provider.getTokenBalances(req.address)
//...
}
return super._translatePerform(provider, req)
}
}
Describe the Feature
FallbackProviderdoesn't allow sending a request that has a custom method, ex:alchemy_getTokenBalances. We need a way to do that similar to thesendfunction inJsonRpcProviderCode Example