aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/contract_templates/partials/call.handlebars
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-02-06 05:02:48 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-02-07 09:26:12 +0800
commit897515c00207a11f7a45932d3c526a5eaf961635 (patch)
tree9282ffabd4242c73af49154fa963ebc3378bd935 /packages/contracts/contract_templates/partials/call.handlebars
parent4c9c4c487a034d926443eeb8a0154fd38c97aca3 (diff)
downloaddexon-0x-contracts-897515c00207a11f7a45932d3c526a5eaf961635.tar.gz
dexon-0x-contracts-897515c00207a11f7a45932d3c526a5eaf961635.tar.zst
dexon-0x-contracts-897515c00207a11f7a45932d3c526a5eaf961635.zip
Add CLI option for networkId, add abi-gen to contracts package
Diffstat (limited to 'packages/contracts/contract_templates/partials/call.handlebars')
-rw-r--r--packages/contracts/contract_templates/partials/call.handlebars15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/contracts/contract_templates/partials/call.handlebars b/packages/contracts/contract_templates/partials/call.handlebars
new file mode 100644
index 000000000..0475136f0
--- /dev/null
+++ b/packages/contracts/contract_templates/partials/call.handlebars
@@ -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;
+ },
+};