Skip to content

Commit

Permalink
Improve help for view/call operations
Browse files Browse the repository at this point in the history
  • Loading branch information
janedegtiareva committed Jul 24, 2020
1 parent c76adb9 commit fd76c47
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/near-cli.js
Expand Up @@ -128,7 +128,12 @@ const deploy = {
const callViewFunction = {
command: 'view <contractName> <methodName> [args]',
desc: 'make smart contract call which can view state',
builder: (yargs) => yargs,
builder: (yargs) => yargs
.option('args', {
desc: 'Arguments to the view call, in JSON format (e.g. \'{"param_a": "value"}\')',
type: 'string',
default: null
}),
handler: exitOnError(main.callViewFunction)
};

Expand Down
8 changes: 8 additions & 0 deletions commands/call.js
Expand Up @@ -16,6 +16,14 @@ module.exports = {
desc: 'Number of tokens to attach',
type: 'string',
default: '0'
})
.option('args', {
desc: 'Arguments to the contract call, in JSON format (e.g. \'{"param_a": "value"}\')',
type: 'string',
default: null
})
.option('accountId', {
required: true,
}),
handler: exitOnError(scheduleFunctionCall)
};
Expand Down

0 comments on commit fd76c47

Please sign in to comment.