From e51815150912d10e2734707986b10b37c87d6d12 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Wed, 20 Nov 2019 18:28:13 +0900 Subject: [PATCH] Fixed null apiKey problem for InfuraProvider. --- packages/providers/src.ts/infura-provider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/providers/src.ts/infura-provider.ts b/packages/providers/src.ts/infura-provider.ts index 795eeb1a5f..a2d31285cd 100644 --- a/packages/providers/src.ts/infura-provider.ts +++ b/packages/providers/src.ts/infura-provider.ts @@ -18,11 +18,13 @@ export class InfuraProvider extends UrlJsonRpcProvider { static getApiKey(apiKey: any): any { const apiKeyObj: { apiKey: string, projectId: string, projectSecret: string } = { - apiKey: null, + apiKey: defaultProjectId, projectId: defaultProjectId, projectSecret: null }; + if (apiKey == null) { return apiKeyObj; } + if (typeof(apiKey) === "string") { apiKeyObj.projectId = apiKey;