aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/abi-gen/README.md27
1 files changed, 18 insertions, 9 deletions
diff --git a/packages/abi-gen/README.md b/packages/abi-gen/README.md
index 5232e59ce..899b4845e 100644
--- a/packages/abi-gen/README.md
+++ b/packages/abi-gen/README.md
@@ -16,24 +16,33 @@ For an example of the generated [wrapper files](https://github.com/0xProject/0x-
```
abi-gen
Options:
- --help Show help [boolean]
- --version Show version number [boolean]
- --abiGlob Glob pattern to search for ABI JSON files [string] [required]
- --templates Folder where to search for templates [string] [required]
- --output Folder where to put the output files [string] [required]
+ --help Show help [boolean]
+ --version Show version number [boolean]
+ --abis Glob pattern to search for ABI JSON files
+ [string] [required]
+ --output, -o, --out Folder where to put the output files [string] [required]
+ --partials Glob pattern for the partial template files [string]
+ --template Path for the main template file that will be used to
+ generate each contract [string] [required]
+ --backend The backing Ethereum library your app uses. Either 'web3'
+ or 'ethers'. Ethers auto-converts small ints to numbers
+ whereas Web3 doesn't.
+ [string] [choices: "web3", "ethers"] [default: "web3"]
+ --network-id ID of the network where contract ABIs are nested in
+ artifacts [number] [default: 50]
```
-## ABI files
-
You're required to pass a [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) template where your abi files are located.
TL;DR - here is the example from 0x.js.
-`--abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json`
+`--abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json`
-We could've just used `--abiGlob 'src/artifacts/*.json` but we wanted to exclude some of the abi files.
+We could've just used `--abis 'src/artifacts/*.json` but we wanted to exclude some of the abi files.
The abi file should be either a [Truffle](http://truffleframework.com/) contract artifact (a JSON object with an abi key) or a JSON abi array.
+You need to also specify the location of your main template used for every contract `--template` as well as the partial templates `--partials` that can later be used from the main one.
+
## How to write custom templates?
The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x-monorepo/tree/development/packages/0x.js/contract_templates) and start adjusting them for your needs.