zonder
Version:
Ergonomic multi-chain indexing framework with dual runtime support for Ponder and Envio.
20 lines (19 loc) • 554 B
JavaScript
import { buildConfig } from '../ponder/index.js';
import { validateZonderConfig } from './validateConfig.js';
export function zonder(config) {
validateZonderConfig(config);
return {
...config,
toPonder() {
let builtConfig = null;
return new Proxy({}, {
get(_, prop) {
if (!builtConfig) {
builtConfig = buildConfig(config);
}
return builtConfig[prop];
},
});
},
};
}