2

While fetching details of account using private SEED on stellar test net I am getting the below error:

 Error response from the server.
at org.stellar.sdk.requests.ResponseHandler.handleResponse(ResponseHandler.java:38)

Code Snippet .

SOURCE_KEY_PAIR = KeyPair.fromSecretSeed(StellarRedis.STELLAR_BASE_ACCOUNT_SEED.getKeys().getBytes());
SOURCE_ACCOUNT = STELLAR_SERVER.accounts().account(SOURCE_KEY_PAIR);
1

Not very sure about StellarRedis. This could be an alternative.

Say, your secret seed is "__SEED__".

//

var StellarSdk = require('stellar-sdk');
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');

var PUB_checkAc = StellarSdk.Keypair.fromSecret(__SEED__).publicKey()

server.loadAccount(PUB_checkAc)
  .then(function(account) {
        console.log('Balances for account: ' + PUB_checkAc);
        account.balances.forEach(function(assetBalance) {
          console.log('Name:', assetBalance.asset_code, ', Balance:', assetBalance.balance, 'Type:', assetBalance.asset_type);
        });
      })

https://stellar.github.io/js-stellar-sdk/Keypair.html#.fromSecret

The documents are often not up to date, so some methods fail without surprise. And please make sure your account has been created (funded already).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.