Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
fix: fixed error on empty methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gagdiez committed Mar 18, 2024
1 parent 15cb2fc commit 8d4e4fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/keys/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
desc: 'Method names to limit access key to (example: --method-names meth1 meth2)',
type: 'array',
required: false,
default: []
})
.option('allowance', {
desc: 'Allowance in $NEAR for the key (default 0)',
Expand Down Expand Up @@ -47,7 +48,7 @@ async function addAccessKey(options) {
await assertCredentials(options.accountId, options.networkId, options.keyStore, options.useLedgerKey);

console.log(`Adding ${options.contractId ? 'function call access' : 'full access'} key ${options.publicKey} to ${options.accountId}.`);
if (options.contractId) console.log(`Limited to: ${options.allowance} $NEAR and methods: ${options.methodNames.join(' ')}.`);
if (options.contractId) console.log(`Limited to: ${options.allowance} $NEAR and methods: [${options.methodNames.join(' ')}].`);

const near = await connect(options);
const account = await near.account(options.accountId);
Expand Down

0 comments on commit 8d4e4fa

Please sign in to comment.