Module

Data.CodeGen

Package
purescript-web3-generator
Repository
f-o-a-m/purescript-web3-generator

#GeneratorOptions Source

type GeneratorOptions = { exprPrefix :: String, jsonDir :: FilePath, modulePrefix :: String, pursDir :: FilePath, truffle :: Boolean }

#ModuleImportsAcc Source

type ModuleImportsAcc = { imports :: Array String, types :: Map ModuleName IsCtrInImports }

#generatePS Source

generatePS :: forall e. GeneratorOptions -> Aff (console :: CONSOLE, fs :: FS | e) Unit

#writeCodeFromAbi Source

writeCodeFromAbi :: forall e. GeneratorOptions -> FilePath -> FilePath -> Aff (fs :: FS | e) Unit

read in json abi and write the generated code to a destination file

#parseAbi Source

parseAbi :: forall r. { truffle :: Boolean | r } -> Json -> Either String Abi

#getAllDirectories Source

getAllDirectories :: forall m eff. MonadAff (fs :: FS | eff) m => MonadState FilePath m => m (Array FilePath)

Helpers

#validateRootedDir Source

validateRootedDir :: forall m eff. MonadAff (fs :: FS | eff) m => FilePath -> FilePath -> m (Maybe FilePath)

#getJsonFilesInDirectory Source

getJsonFilesInDirectory :: forall m eff. MonadAff (fs :: FS | eff) m => MonadState FilePath m => m (Array FilePath)

get all files in a directory with a ".json" extension

#validateFile Source

validateFile :: forall m eff. MonadAff (fs :: FS | eff) m => FilePath -> FilePath -> m (Maybe FilePath)

determine whether the file is a .json artifact

#getAllJsonFiles Source

getAllJsonFiles :: forall m eff. MonadAff (fs :: FS | eff) m => FilePath -> m (Array FilePath)