Getting the token information

Get the ownership, divisibility, duration, and flags for a given token identifier.

Prerequisites

Method #01: Using the SDK

// replace with token id
const tokenIdHex = '71415AC19C818709';
const tokenId = new TokenId(tokenIdHex);

// replace with node endpoint
const nodeUrl = 'NODE_URL';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const tokenHttp = repositoryFactory.createTokenRepository();

tokenHttp.getToken(tokenId).subscribe(
  (tokenInfo) => console.log(tokenInfo),
  (err) => console.error(err),
);
// replace with token id
const tokenIdHex = '71415AC19C818709';
const tokenId = new bitxor_sdk_1.TokenId(tokenIdHex);
// replace with node endpoint
const nodeUrl = 'NODE_URL';
const repositoryFactory = new bitxor_sdk_1.RepositoryFactoryHttp(nodeUrl);
const tokenHttp = repositoryFactory.createTokenRepository();
tokenHttp.getToken(tokenId).subscribe(
  (tokenInfo) => console.log(tokenInfo),
  (err) => console.error(err),
);
        try (final RepositoryFactory repositoryFactory = new RepositoryFactoryVertxImpl(
                "NODE_URL")) {
            // replace with token id
            final String tokenIdHex = "71415AC19C818709";
            final TokenId tokenId = new TokenId(tokenIdHex);

            final TokenRepository tokenRepository = repositoryFactory
                    .createTokenRepository();

            final TokenInfo tokenInfo = tokenRepository.getToken(tokenId)
                    .toFuture()
                    .get();
            final JsonHelper helper = new JsonHelperJackson2();
            System.out.println(helper.prettyPrint(tokenInfo));
        }

Method #02: Using the CLI

bitxor-cli token info --token-id 71415AC19C818709