Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
generateKeyPair(seed?: Buffer): KeyPair {
const pair = seed ? generateAccountFromSeed(seed) : generateAccount();
return {
pub: pair.addr, // encoded pub
prv: Seed.encode(pair.sk), // encoded seed
};
}
convertFromStellarSeed(seed: string): string | null {
// assume this is a trust custodial seed if its a valid ed25519 prv
if (!this.isStellarSeed(seed)) {
return null;
}
return Seed.encode(stellar.StrKey.decodeEd25519SecretSeed(seed));
}