モザイクの情報を取得する

モザイク識別子による所有権、可分性、期間、フラグの取得

前提条件

方法 #01: SDK を使用する

// replace with mosaic id
const mosaicIdHex = '71415AC19C818709';
const mosaicId = new MosaicId(mosaicIdHex);

// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.testnet.symboldev.network:3000';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const mosaicHttp = repositoryFactory.createMosaicRepository();

mosaicHttp.getMosaic(mosaicId).subscribe(
  (mosaicInfo) => console.log(mosaicInfo),
  (err) => console.error(err),
);
// replace with mosaic id
const mosaicIdHex = '71415AC19C818709';
const mosaicId = new symbol_sdk_1.MosaicId(mosaicIdHex);
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.testnet.symboldev.network:3000';
const repositoryFactory = new symbol_sdk_1.RepositoryFactoryHttp(nodeUrl);
const mosaicHttp = repositoryFactory.createMosaicRepository();
mosaicHttp.getMosaic(mosaicId).subscribe(
  (mosaicInfo) => console.log(mosaicInfo),
  (err) => console.error(err),
);
        try (final RepositoryFactory repositoryFactory = new RepositoryFactoryVertxImpl(
                "http://api-01.us-east-1.testnet.symboldev.network:3000")) {
            // replace with mosaic id
            final String mosaicIdHex = "71415AC19C818709";
            final MosaicId mosaicId = new MosaicId(mosaicIdHex);

            final MosaicRepository mosaicRepository = repositoryFactory
                    .createMosaicRepository();

            final MosaicInfo mosaicInfo = mosaicRepository.getMosaic(mosaicId)
                    .toFuture()
                    .get();
            final JsonHelper helper = new JsonHelperJackson2();
            System.out.println(helper.prettyPrint(mosaicInfo));
        }

方法 #02: CLI を使用する

symbol-cli mosaic info --mosaic-id 71415AC19C818709