From b28483b38e00e6821a362ee37ce95fbcf10b6507 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 25 Nov 2024 10:41:18 -0800 Subject: [PATCH] Fix default API key handling --- CHANGELOG.md | 2 ++ src/core/root.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ee90d49..48b89fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- fixed: Accept `''` to select the default API key. + ## 2.20.2 (2024-11-21) - fixed: Do not error when changing the PIN on accounts with children. diff --git a/src/core/root.ts b/src/core/root.ts index 9ade7a18..e74470f8 100644 --- a/src/core/root.ts +++ b/src/core/root.ts @@ -35,7 +35,6 @@ export async function makeContext( const { io } = ios const { airbitzSupport = false, - apiKey = '4248c1bf41e53b840a5fdb2c872dd3ade525e66d', apiSecret, appId = '', authServer = 'https://login.edge.app/api', @@ -46,6 +45,10 @@ export async function makeContext( skipBlockHeight = false, syncServer } = opts + let { apiKey } = opts + if (apiKey == null || apiKey === '') { + apiKey = '4248c1bf41e53b840a5fdb2c872dd3ade525e66d' + } const infoServers = typeof infoServer === 'string' ? [infoServer]