diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-24 03:35:44 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-28 04:05:23 +0800 |
commit | 2d561bc8a05e8d1fca91cde93bae2080d87be926 (patch) | |
tree | 10d785eff73c67ecae09a337ed3721ff6b6102a9 /packages/0x.js/contract_templates/contract.handlebars | |
parent | f5275d3ad75d2a989556de99cdef82bcf2cd687c (diff) | |
download | dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.gz dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.bz2 dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.lz dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.xz dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.tar.zst dexon-0x-contracts-2d561bc8a05e8d1fca91cde93bae2080d87be926.zip |
Allow users to specify the contracts backend in abi-gen
Diffstat (limited to 'packages/0x.js/contract_templates/contract.handlebars')
-rw-r--r-- | packages/0x.js/contract_templates/contract.handlebars | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/0x.js/contract_templates/contract.handlebars b/packages/0x.js/contract_templates/contract.handlebars index 33699b8a7..2954145a7 100644 --- a/packages/0x.js/contract_templates/contract.handlebars +++ b/packages/0x.js/contract_templates/contract.handlebars @@ -6,6 +6,9 @@ // tslint:disable-next-line:no-unused-variable import { TxData, TxDataPayable } from '@0xproject/types'; import { BigNumber, classUtils, promisify } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import * as ethersContracts from 'ethers-contracts'; +import * as _ from 'lodash'; import * as Web3 from 'web3'; import {BaseContract} from './base_contract'; @@ -28,6 +31,7 @@ export enum {{contractName}}Events { {{/each}} {{/if}} +// tslint:disable:no-parameter-reassignment export class {{contractName}}Contract extends BaseContract { {{#each methods}} {{#this.constant}} @@ -37,8 +41,8 @@ export class {{contractName}}Contract extends BaseContract { {{> tx contractName=../contractName}} {{/this.constant}} {{/each}} - constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) { - super(web3ContractInstance, defaults); - classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']); + constructor(web3Wrapper: Web3Wrapper, abi: Web3.ContractAbi, address: string) { + super(web3Wrapper, abi, address); + classUtils.bindAll(this, ['_ethersInterface', '_address', '_abi', '_web3Wrapper']); } } // tslint:disable:max-file-line-count |