From 02e7354b5324b80f1e5a6a2968d05de44820498c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 8 Dec 2017 17:58:54 +0300 Subject: Move 0x.js temnplates to 0x.js instead of having them as a separate package --- packages/0x.js/contract_templates/partials/call.mustache | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 packages/0x.js/contract_templates/partials/call.mustache (limited to 'packages/0x.js/contract_templates/partials/call.mustache') diff --git a/packages/0x.js/contract_templates/partials/call.mustache b/packages/0x.js/contract_templates/partials/call.mustache new file mode 100644 index 000000000..ef4bda724 --- /dev/null +++ b/packages/0x.js/contract_templates/partials/call.mustache @@ -0,0 +1,15 @@ +public {{this.name}} = { + async callAsync( + {{> typed_params inputs=inputs}} + defaultBlock?: Web3.BlockParam, + ): Promise<{{> return_type outputs=outputs}}> { + const self = this as {{contractName}}Contract; + const result = await promisify<{{> return_type outputs=outputs}}>( + self.web3ContractInstance.{{this.name}}.call, + self.web3ContractInstance, + )( + {{> params inputs=inputs}} + ); + return result; + }, +}; -- cgit v1.2.3