*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,
|
method: string,
|
||||||
chains: string[] = []
|
chains: string[] = []
|
||||||
): Function {
|
): Function {
|
||||||
return async function (args: any, context: object) {
|
return async function (args: any, context: RpcContext) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let chain = context.chain;
|
let chain = context.chain;
|
||||||
let chainId = maybeMapChainId(chain);
|
let chainId = maybeMapChainId(chain as string);
|
||||||
|
|
||||||
let chainMatch = true;
|
let chainMatch = true;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
chains.length > 0 &&
|
chains.length > 0 &&
|
||||||
!chains.includes(chain) &&
|
!chains.includes(chain as string) &&
|
||||||
!chains.includes(chainId.toString())
|
!chains.includes(chainId.toString())
|
||||||
) {
|
) {
|
||||||
chainMatch = false;
|
chainMatch = false;
|
||||||
|
|
Loading…
Reference in New Issue