Package

purescript-web3-generator

Repository
f-o-a-m/purescript-web3-generator
License
MIT
Uploaded by
blinky3713
Published on
2018-04-12T23:19:08Z

Latest release purescript-web3-generator on Pursuit Build status

Generats purescript modules from Solidity ABIs

Requirements

  • npm
  • psc-package

Getting Started

> git clone
> cd purescript-web3-generator
> npm install
> pulp build
> pulp test

How to use it

For a complete example that follows the steps below, see purescript-web3-example.

We use purescript-web3-generator in the absence of template-purescript. Suggested usage is as follows:

  1. Create a directory generator/ in your project with a file that looks like this
module Generator where

import Data.GeneratorMain (generatorMain)

main = generatorMain
  1. From there, add a build step
pulp -m Generator --src-path generator run -- --abis <abis> --dest src --module Contracts ...

(note that we specify both a different source directory than src and a different module Generator that purs is looking for main in)

Until this issue is fixed, we have to temporarily replace the step above with something like this

pulp -m Generator --src-path generator build --to generator.js
node generator.js --abis <abis> --dest src --module Contracts ...
rm generator.js
  1. Now you should have created contract modules for each contract into your src/Contracts directory that your code can depend on. you could use --module MyApp.Contracts for example too and it will result in modules created in src/MyApp/Contracts

Documentation

Module documentation is published on Pursuit.

Resources