diff options
Diffstat (limited to 'packages/typed-contracts-templates/contract.mustache')
-rw-r--r-- | packages/typed-contracts-templates/contract.mustache | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/typed-contracts-templates/contract.mustache b/packages/typed-contracts-templates/contract.mustache new file mode 100644 index 000000000..e37ceb838 --- /dev/null +++ b/packages/typed-contracts-templates/contract.mustache @@ -0,0 +1,23 @@ +import {BigNumber} from 'bignumber.js'; +import * as Web3 from 'web3'; + +import {TxData, TxDataPayable} from '../../types'; +import {classUtils} from '../../utils/class_utils'; +import {promisify} from '../../utils/promisify'; + +import {BaseContract} from './base_contract'; + +export class {{contractName}}Contract extends BaseContract { +{{#each methodAbis}} + {{#this.constant}} + {{> call contractName=../contractName}} + {{/this.constant}} + {{^this.constant}} + {{> tx contractName=../contractName}} + {{/this.constant}} +{{/each}} + constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) { + super(web3ContractInstance, defaults); + classUtils.bindAll(this, ['web3ContractInstance', 'defaults']); + } +} // tslint:disable:max-file-line-count |