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

1 Answer 1

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) {

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 and acknowledge you have read our privacy policy.

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