feat: Add vault through utils + sdk

This commit is contained in:
BluJ
2023-05-09 15:55:19 -06:00
parent 86cee9e788
commit f8a63f6e38
23 changed files with 427 additions and 311 deletions

View File

@@ -23,17 +23,17 @@ import "./Daemons"
* @param fn
* @returns
*/
export const setupMain = <Store>(
export const setupMain = <Store, Vault>(
fn: (o: {
effects: Effects
started(onTerm: () => void): null
utils: Utils<Store, {}>
utils: Utils<Store, Vault, {}>
}) => Promise<Daemons<any>>,
): ExpectedExports.main => {
return async (options) => {
const result = await fn({
...options,
utils: createMainUtils<Store>(options.effects),
utils: createMainUtils<Store, Vault>(options.effects),
})
await result.build().then((x) => x.wait())
}