Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve help for view/call operations #472

Merged
merged 2 commits into from Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
10 changes: 10 additions & 0 deletions commands/call.js
Expand Up @@ -16,6 +16,16 @@ 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,
desc: 'Unique identifier for the account that will be used to sign this call',
type: 'string',
}),
handler: exitOnError(scheduleFunctionCall)
};
Expand Down