1

In the recent core v10.3, there is a new base64 encoded column in the accounts table in the core db which replaces the signers table in earlier core versions. How can I decode this column to produce a backwards compatible array:

[{publicKey, weight}]

using the js sdk?

Thanks in advance

4
var StellarBase = require('stellar-base');
var jsxdr = require('js-xdr');

let signers = new jsxdr.VarArray(StellarBase.xdr.Signer, 20)
  .fromXDR('AAAAAQAAAAC+GwdMJxaEbnW0z0RP6jJvTg+s8mjVw7+wPpJEbZAJdQAAAAo=', 'base64');

for (signer of signers) {
  console.log(signer.key());
  console.log(signer.weight());
}

Please note that the column will be NULL when there are no signers added to the account.

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.