diff options
Diffstat (limited to 'packages/0x.js/contract_templates')
-rw-r--r-- | packages/0x.js/contract_templates/contract.handlebars | 20 | ||||
-rw-r--r-- | packages/0x.js/contract_templates/partials/event.handlebars | 5 |
2 files changed, 24 insertions, 1 deletions
diff --git a/packages/0x.js/contract_templates/contract.handlebars b/packages/0x.js/contract_templates/contract.handlebars index d3fe1b8cc..227cfcc5a 100644 --- a/packages/0x.js/contract_templates/contract.handlebars +++ b/packages/0x.js/contract_templates/contract.handlebars @@ -1,6 +1,6 @@ /** * 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. + * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/0x.js/contract_templates. */ // tslint:disable-next-line:no-unused-variable import { TxData, TxDataPayable } from '@0xproject/types'; @@ -9,6 +9,24 @@ import * as Web3 from 'web3'; import {BaseContract} from './base_contract'; +{{#if events}} +export type {{contractName}}ContractEventArgs = +{{#each events}} + | {{name}}ContractEventArgs{{#if @last}};{{/if}} +{{/each}} + +export enum {{contractName}}Events { + {{#each events}} + {{name}} = '{{name}}', + {{/each}} +} + +{{#each events}} +{{> event}} + +{{/each}} +{{/if}} + export class {{contractName}}Contract extends BaseContract { {{#each methods}} {{#this.constant}} diff --git a/packages/0x.js/contract_templates/partials/event.handlebars b/packages/0x.js/contract_templates/partials/event.handlebars new file mode 100644 index 000000000..8f8676a4f --- /dev/null +++ b/packages/0x.js/contract_templates/partials/event.handlebars @@ -0,0 +1,5 @@ +export interface {{name}}ContractEventArgs { + {{#each inputs}} + {{name}}: {{#returnType type}}{{/returnType}}, + {{/each}} +}; |