*Set context to RpcContext and ass type asserts
This commit is contained in:
parent
c95917f789
commit
1fd1c932ca
|
@ -42,16 +42,16 @@ export function proxyRpcMethod(
|
|||
method: string,
|
||||
chains: string[] = []
|
||||
): Function {
|
||||
return async function (args: any, context: object) {
|
||||
return async function (args: any, context: RpcContext) {
|
||||
// @ts-ignore
|
||||
let chain = context.chain;
|
||||
let chainId = maybeMapChainId(chain);
|
||||
let chainId = maybeMapChainId(chain as string);
|
||||
|
||||
let chainMatch = true;
|
||||
|
||||
if (
|
||||
chains.length > 0 &&
|
||||
!chains.includes(chain) &&
|
||||
!chains.includes(chain as string) &&
|
||||
!chains.includes(chainId.toString())
|
||||
) {
|
||||
chainMatch = false;
|
||||
|
|
Loading…
Reference in New Issue