aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/src/utils/class_utils.ts2
-rw-r--r--packages/abi-gen/README.md16
-rw-r--r--packages/abi-gen/package.json2
3 files changed, 10 insertions, 10 deletions
diff --git a/packages/0x.js/src/utils/class_utils.ts b/packages/0x.js/src/utils/class_utils.ts
index b89d3ba32..04e60ee57 100644
--- a/packages/0x.js/src/utils/class_utils.ts
+++ b/packages/0x.js/src/utils/class_utils.ts
@@ -1,7 +1,7 @@
import * as _ from 'lodash';
export const classUtils = {
- // This is usefull for classes that have nested methods. Nested methods don't get binded out of the box.
+ // This is useful for classes that have nested methods. Nested methods don't get bound out of the box.
bindAll(self: any, exclude: string[] = ['contructor'], thisArg?: any): void {
for (const key of Object.getOwnPropertyNames(self)) {
const val = self[key];
diff --git a/packages/abi-gen/README.md b/packages/abi-gen/README.md
index 40f056a52..f1f8bd08f 100644
--- a/packages/abi-gen/README.md
+++ b/packages/abi-gen/README.md
@@ -1,10 +1,10 @@
-# Typed contracts
+# ABI Gen
This package allows you to generate contract wrappers in any language from ABI files.
It's heavily inspired by [Geth abigen](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) but takes a different approach.
You can write your custom handlebars templates which will allow you to seamlessly integrate the generated code into your existing codebase with existing conventions.
-For the example of the generated [wrapper files](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/src/contract_wrappers/generated) check out 0x.js.
+For an example of the generated [wrapper files](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/src/contract_wrappers/generated) check out 0x.js.
[Here](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates) are the templates used to generate those files.
## Instalation
@@ -22,19 +22,19 @@ Options:
```
## 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 exmaple from 0x.js.
+TL;DR - here is the example from 0x.js.
`--abiGlob '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.
-The abi file should be either a truffle contract artifact (a JSON object with the abi key) or a JSON abi array.
+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.
## How to write custom templates?
-The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates) and start playing with them adjusting them for your needs.
+The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates) and start adjusting them for your needs.
We use [handlebars](handlebarsjs.com) template engine under the hood.
-You need to have a master template called `contract.mustache`. it will be used to generate each contract wrapper. Although - you don't need and probably shouldn't write all your logic in a single template file. You can write [partial templates](http://handlebarsjs.com/partials.html) and as long as they are within partials folder - they will be registered and available.
+You need to have a master template called `contract.mustache`. it will be used to generate each contract wrapper. Although - you don't need and probably shouldn't write all your logic in a single template file. You can write [partial templates](http://handlebarsjs.com/partials.html) and as long as they are within a partials folder - they will be registered and available.
## Which data/context do I get in my templates?
-For now you don't get much on top of methods abi and a contract name cause if was enough for our use-case, but if you need something else - create a PR.
+For now you don't get much on top of methods abi and a contract name because it was enough for our use-case, but if you need something else - create a PR.
[Type definition](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen/src/types.ts) of what we pass to a render method.
## Output files
-Output files will be generated within an output folder with names converted to camel case and taken from abi files names. If you already have some files in that folder they will be overwritten.
+Output files will be generated within an output folder with names converted to camel case and taken from abi file names. If you already have some files in that folder they will be overwritten.
diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json
index 01bede249..defe4a621 100644
--- a/packages/abi-gen/package.json
+++ b/packages/abi-gen/package.json
@@ -22,7 +22,6 @@
},
"homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md",
"dependencies": {
- "@types/handlebars": "^4.0.36",
"bignumber.js": "^5.0.0",
"chalk": "^2.3.0",
"glob": "^7.1.2",
@@ -34,6 +33,7 @@
"yargs": "^10.0.3"
},
"devDependencies": {
+ "@types/handlebars": "^4.0.36",
"@0xproject/tslint-config": "^0.2.0",
"@types/glob": "^5.0.33",
"@types/mkdirp": "^0.5.1",