mirror of
https://github.com/Retropex/mempool-startos.git
synced 2025-05-15 20:50:45 +02:00

* rename scripts folder to procedures * update embassy to start commands * bump package and lnd version
30 lines
937 B
TypeScript
30 lines
937 B
TypeScript
import { compat, types as T } from "../deps.ts";
|
|
|
|
// Define a custom type for T.Config to include the 'lightning' property with a 'type' property
|
|
interface CustomConfig extends T.Config {
|
|
lightning?: {
|
|
type?: string;
|
|
};
|
|
}
|
|
// deno-lint-ignore require-await
|
|
export const setConfig: T.ExpectedExports.setConfig = async (
|
|
effects: T.Effects,
|
|
newConfig: CustomConfig
|
|
) => {
|
|
const dependsOnElectrs: { [key: string]: string[] } = newConfig?.[
|
|
"enable-electrs"
|
|
]
|
|
? { electrs: ["synced"] }
|
|
: {};
|
|
|
|
// add two const depsLnd and depsCln for the new lightning type string in getConfig
|
|
const depsLnd: { [key: string]: string[] } = newConfig?.lightning?.type === "lnd" ? {lnd: []} : {};
|
|
const depsCln: { [key: string]: string[] } = newConfig?.lightning?.type === "cln" ? {"c-lightning": []} : {};
|
|
|
|
return compat.setConfig(effects, newConfig, {
|
|
...dependsOnElectrs,
|
|
...depsLnd,
|
|
...depsCln,
|
|
});
|
|
};
|