XYOracleNetwork/clients

View on GitHub
packages/modules-mongo/src/PreviousHashStore/addPreviousHashStore.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Account } from '@xyo-network/account'
import { COLLECTIONS, getBaseMongoSdk } from '@xyo-network/module-abstract-mongodb'

import type { AddressInfo } from '../Mongo/index.js'
import { MongoDBPreviousHashStore } from './MongoDBPreviousHashStore.js'

export const addPreviousHashStore = () => {
  if (process.env.STORE_PREVIOUS_HASH) {
    const store = new MongoDBPreviousHashStore(getBaseMongoSdk<AddressInfo>(COLLECTIONS.AddressInfo))
    Account.previousHashStore = store
  }
}