Skip to content

Commit

Permalink
multiple methods can be added at once in add-key
Browse files Browse the repository at this point in the history
  • Loading branch information
volovyks committed Mar 10, 2021
1 parent 6c2995b commit c7e85fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands/add-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module.exports = {
required: false,
})
.option('method-names', {
desc: 'Method names to limit access key to (comma separated)',
type: 'string',
desc: 'Method names to limit access key to (example: --method-names meth1 meth2)',
type: 'array',
required: false,
})
.option('allowance', {
Expand All @@ -36,6 +36,6 @@ async function addAccessKey(options) {
const near = await connect(options);
const account = await near.account(options.accountId);
const allowance = utils.format.parseNearAmount(options.allowance);
const result = await account.addKey(options.accessKey, options.contractId, options.methodNames && options.methodNames.split(','), allowance);
const result = await account.addKey(options.accessKey, options.contractId, options.methodNames, allowance);
inspectResponse.prettyPrintResponse(result, options);
}

0 comments on commit c7e85fd

Please sign in to comment.