Getting the account restrictions attached to an address

Get the list of account’s restrictions.

Method #01: Using the SDK

// replace with address
const rawAddress = 'TAEG6L-KWXRA7-PSWUEE-ILQPG4-3V5CYZ-S5652T-JTUU';
const address = Address.createFromRawAddress(rawAddress);
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const restrictionHttp = repositoryFactory.createRestrictionAccountRepository();

restrictionHttp.getAccountRestrictions(address)
    .subscribe((accountRestrictions) => {
        if (accountRestrictions.length > 0) {
            accountRestrictions
                .filter((accountRestriction) => accountRestriction.values.length > 0)
                .map((accountRestriction) => {
                    console.log('\n', accountRestriction.restrictionFlags, accountRestriction.values.toString());
                });
        } else {
            console.log('The address does not have account restriction assigned.');
        }
    }, (err) => console.log(err));
// replace with address
const rawAddress = 'TAEG6L-KWXRA7-PSWUEE-ILQPG4-3V5CYZ-S5652T-JTUU';
const address = symbol_sdk_1.Address.createFromRawAddress(rawAddress);
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
const repositoryFactory = new symbol_sdk_1.RepositoryFactoryHttp(nodeUrl);
const restrictionHttp = repositoryFactory.createRestrictionAccountRepository();
restrictionHttp.getAccountRestrictions(address)
    .subscribe((accountRestrictions) => {
    if (accountRestrictions.length > 0) {
        accountRestrictions
            .filter((accountRestriction) => accountRestriction.values.length > 0)
            .map((accountRestriction) => {
            console.log('\n', accountRestriction.restrictionFlags, accountRestriction.values.toString());
        });
    }
    else {
        console.log('The address does not have account restriction assigned.');
    }
}, (err) => console.log(err));
        // replace with node endpoint
        try (final RepositoryFactory repositoryFactory = new RepositoryFactoryVertxImpl(
                "http://api-01.us-east-1.096x.symboldev.network:3000")) {
            final RestrictionAccountRepository restrictionRepository = repositoryFactory
                    .createRestrictionAccountRepository();

            // replace with address
            final String rawAddress = "TAEG6L-KWXRA7-PSWUEE-ILQPG4-3V5CYZ-S5652T-JTUU";
            final Address address = Address.createFromRawAddress(rawAddress);

            final AccountRestrictions restrictions = restrictionRepository
                    .getAccountRestrictions(address)
                    .toFuture().get();
            final JsonHelper helper = new JsonHelperJackson2();
            System.out.println(helper.prettyPrint(restrictions));
        }

Method #02: Using the CLI

symbol-cli restriction account --address TAEG6L-KWXRA7-PSWUEE-ILQPG4-3V5CYZ-S5652T-JTUU