Obtenga la clave p煤blica y el saldo de una cuenta.
Completar la getting started section.
Crear an account.
Abra un nuevo archivo y llame a la funci贸n getAccountInfo
desde el repositorio AccountHttp
.
Pase la direcci贸n de su cuenta como par谩metro.
// replace with address
const rawAddress = 'BXRQ5E-YACWBP-CXKGIL-I6XWCH-DRFLTB-KUK34I-YJQ';
const address = Address.createFromRawAddress(rawAddress);
// replace with node endpoint
const nodeUrl = 'NODE_URL';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const accountHttp = repositoryFactory.createAccountRepository();
accountHttp.getAccountInfo(address).subscribe(
(accountInfo) => console.log(accountInfo),
(err) => console.error(err),
);
// replace with address
const rawAddress = 'BXRQ5E-YACWBP-CXKGIL-I6XWCH-DRFLTB-KUK34I-YJQ';
const address = bitxor_sdk_1.Address.createFromRawAddress(rawAddress);
// replace with node endpoint
const nodeUrl = 'NODE_URL';
const repositoryFactory = new bitxor_sdk_1.RepositoryFactoryHttp(nodeUrl);
const accountHttp = repositoryFactory.createAccountRepository();
accountHttp.getAccountInfo(address).subscribe(
(accountInfo) => console.log(accountInfo),
(err) => console.error(err),
);
// replace with node endpoint
try (final RepositoryFactory repositoryFactory = new RepositoryFactoryVertxImpl(
"NODE_URL")) {
final AccountRepository accountRepository = repositoryFactory
.createAccountRepository();
// Replace with an address
final String rawAddress = "BXRQ5E-YACWBP-CXKGIL-I6XWCH-DRFLTB-KUK34I-YJQ";
final Address address = Address.createFromRawAddress(rawAddress);
final AccountInfo accountInfo = accountRepository
.getAccountInfo(address).toFuture().get();
final JsonHelper helper = new JsonHelperJackson2();
System.out.println(helper.prettyPrint(accountInfo));
}
Abra una ventana de terminal y ejecute el siguiente comando.
Reemplazar BXRBDE-NCLKEB-ILBPWP-3JPB2X-NY64OE-7PYHHE-32I
con la direcci贸n que desea consultar.
bitxor-cli account info --address BXRBDE-NCLKEB-ILBPWP-3JPB2X-NY64OE-7PYHHE-32I