Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from: (value: string | null) => {
if (!value) {
return null;
}
const signersArray = new VarArray(xdr.Signer).fromXDR(value, "base64");
return signersArray.map((signerXDR: any) => SignerFactory.fromXDR(signerXDR));
},
// we don't actually need `to` transform,
public static fromDb(row: IAccountTableRow): Account {
const data: IAccount = {
id: row.accountid,
balance: row.balance,
sequenceNumber: row.seqnum,
numSubentries: row.numsubentries,
inflationDestination: row.inflationdest,
homeDomain: row.homedomain,
lastModified: row.lastmodified,
thresholds: AccountThresholdsFactory.fromValue(row.thresholds),
flags: AccountFlagsFactory.fromValue(row.flags)
};
if (row.signers) {
const signersArray = new VarArray(xdr.Signer).fromXDR(row.signers, "base64");
data.signers = signersArray.map((signerXDR: any) => SignerFactory.fromXDR(signerXDR, row.accountid));
}
return new Account(data);
}
}