import { compat, types as T } from "../deps.ts"; interface KamadoConfig extends T.Config { bitcoind?: { type?: string; }; } // deno-lint-ignore require-await export const setConfig: T.ExpectedExports.setConfig = async ( effects: T.Effects, newConfig: KamadoConfig, ) => { const mainnetDep: { [key: string]: string[] } = newConfig?.bitcoind?.type === "bitcoind" ? { bitcoind: [] } : {}; const testnetDep: { [key: string]: string[] } = newConfig?.bitcoind?.type === "bitcoind-testnet" ? { "bitcoind-testnet": [] } : {}; return compat.setConfig(effects, newConfig, { ...mainnetDep, ...testnetDep, }); };