Package

purescript-web3-generator

Repository
f-o-a-m/purescript-web3-generator
License
MIT
Uploaded by
blinky3713

Latest release 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/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/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.

Documentation

Module documentation is published on Pursuit.

Resources