diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-08 22:58:54 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-14 22:47:02 +0800 |
commit | 02e7354b5324b80f1e5a6a2968d05de44820498c (patch) | |
tree | 83dd425b01afa2eddcb36456da40ae721953020b | |
parent | 0a0d3503c0cdf16c0630dabc9eefba6e7b0a42fe (diff) | |
download | dexon-sol-tools-02e7354b5324b80f1e5a6a2968d05de44820498c.tar dexon-sol-tools-02e7354b5324b80f1e5a6a2968d05de44820498c.tar.gz dexon-sol-tools-02e7354b5324b80f1e5a6a2968d05de44820498c.tar.bz2 dexon-sol-tools-02e7354b5324b80f1e5a6a2968d05de44820498c.tar.lz dexon-sol-tools-02e7354b5324b80f1e5a6a2968d05de44820498c.tar.xz dexon-sol-tools-02e7354b5324b80f1e5a6a2968d05de44820498c.tar.zst dexon-sol-tools-02e7354b5324b80f1e5a6a2968d05de44820498c.zip |
Move 0x.js temnplates to 0x.js instead of having them as a separate package
-rw-r--r-- | packages/0x.js/contract_templates/contract.mustache (renamed from packages/abi-gen-templates/contract.mustache) | 6 | ||||
-rw-r--r-- | packages/0x.js/contract_templates/partials/call.mustache (renamed from packages/abi-gen-templates/partials/call.mustache) | 0 | ||||
-rw-r--r-- | packages/0x.js/contract_templates/partials/params.mustache (renamed from packages/abi-gen-templates/partials/params.mustache) | 0 | ||||
-rw-r--r-- | packages/0x.js/contract_templates/partials/return_type.mustache (renamed from packages/abi-gen-templates/partials/return_type.mustache) | 0 | ||||
-rw-r--r-- | packages/0x.js/contract_templates/partials/tx.mustache (renamed from packages/abi-gen-templates/partials/tx.mustache) | 0 | ||||
-rw-r--r-- | packages/0x.js/contract_templates/partials/typed_params.mustache (renamed from packages/abi-gen-templates/partials/typed_params.mustache) | 0 | ||||
-rw-r--r-- | packages/abi-gen/README.md | 4 | ||||
-rw-r--r-- | yarn.lock | 4 |
8 files changed, 6 insertions, 8 deletions
diff --git a/packages/abi-gen-templates/contract.mustache b/packages/0x.js/contract_templates/contract.mustache index ec06df507..4c59d4f58 100644 --- a/packages/abi-gen-templates/contract.mustache +++ b/packages/0x.js/contract_templates/contract.mustache @@ -2,13 +2,11 @@ * This file is auto-generated using abi-gen. Don't edit directly. * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates. */ -import {promisify} from '@0xproject/utils'; +import {TxData, TxDataPayable} from '@0xproject/types'; +import {classUtils, promisify} from '@0xproject/utils'; import {BigNumber} from 'bignumber.js'; import * as Web3 from 'web3'; -import {TxData, TxDataPayable} from '../../types'; -import {classUtils} from '../../utils/class_utils'; - import {BaseContract} from './base_contract'; export class {{contractName}}Contract extends BaseContract { diff --git a/packages/abi-gen-templates/partials/call.mustache b/packages/0x.js/contract_templates/partials/call.mustache index ef4bda724..ef4bda724 100644 --- a/packages/abi-gen-templates/partials/call.mustache +++ b/packages/0x.js/contract_templates/partials/call.mustache diff --git a/packages/abi-gen-templates/partials/params.mustache b/packages/0x.js/contract_templates/partials/params.mustache index ac5d4ae85..ac5d4ae85 100644 --- a/packages/abi-gen-templates/partials/params.mustache +++ b/packages/0x.js/contract_templates/partials/params.mustache diff --git a/packages/abi-gen-templates/partials/return_type.mustache b/packages/0x.js/contract_templates/partials/return_type.mustache index 383961a40..383961a40 100644 --- a/packages/abi-gen-templates/partials/return_type.mustache +++ b/packages/0x.js/contract_templates/partials/return_type.mustache diff --git a/packages/abi-gen-templates/partials/tx.mustache b/packages/0x.js/contract_templates/partials/tx.mustache index 8a43e5319..8a43e5319 100644 --- a/packages/abi-gen-templates/partials/tx.mustache +++ b/packages/0x.js/contract_templates/partials/tx.mustache diff --git a/packages/abi-gen-templates/partials/typed_params.mustache b/packages/0x.js/contract_templates/partials/typed_params.mustache index 3ea4b2e95..3ea4b2e95 100644 --- a/packages/abi-gen-templates/partials/typed_params.mustache +++ b/packages/0x.js/contract_templates/partials/typed_params.mustache diff --git a/packages/abi-gen/README.md b/packages/abi-gen/README.md index 16dd9b969..0eaacd86f 100644 --- a/packages/abi-gen/README.md +++ b/packages/abi-gen/README.md @@ -5,7 +5,7 @@ It's heavily inspired by [Geth abigen](https://github.com/ethereum/go-ethereum/w 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 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. +[Here](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/src/contract_templates) are the templates used to generate those files. ## Instalation `yarn add -g @0xproject/abi-gen` @@ -29,7 +29,7 @@ We could've just used `--abiGlob 'src/artifacts/*.json` but we wanted to exclude 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 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/0x.js/src/contract_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 a partials folder - they will be registered and available. ## Which data/context do I get in my templates? @@ -3132,7 +3132,7 @@ ethereumjs-util@4.5.0, ethereumjs-util@^4.0.0, ethereumjs-util@^4.0.1, ethereumj rlp "^2.0.0" secp256k1 "^3.0.1" -ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1: +ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.1.2.tgz#25ba0215cbb4c2f0b108a6f96af2a2e62e45921f" dependencies: @@ -7608,7 +7608,7 @@ request-promise-core@1.1.1: dependencies: lodash "^4.13.1" -request-promise-native@^1.0.4: +request-promise-native@^1.0.4, request-promise-native@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" dependencies: |