-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
- Expected behavior and actual behavior.
While developing a nem2-cli command for getting the account restrictions linked to an address, I have noticed that accountHttp.getAccountRestrictions returns an AccountRestrictionsInfo object, having to navigate throwgh the object as follows:
const accountHttp = new AccountHttp(profile.url);
accountHttp.getAccountRestrictions(address)
.subscribe((accountRestrictions) => {
this.spinner.stop(true);
if (accountRestrictions.accountRestrictions.restrictions.length > 0) {
console.log(new AccountRestrictionsTable(accountRestrictions.accountRestrictions.restrictions).toString());
} else {
console.log('\n The address does not have any account restriction assigned.');
}
}, (err) => {
this.spinner.stop(true);
let text = '';
text += chalk.red('Error');
console.log(text, err.response !== undefined ? err.response.text : err);
});
We could think of returning an array of AccountRestriction[], because we already know the address we are querying and to match other services responses (e.g. blockHttp.getBlockTransactions returns Transaction[] and not a TransactionInfo object)
- Specifications like the version of the project, operating system, or hardware.
- nem2-sdk@0.13.3
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request