本文整理汇总了TypeScript中stellar-sdk.StrKey.decodeEd25519SecretSeed方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StrKey.decodeEd25519SecretSeed方法的具体用法?TypeScript StrKey.decodeEd25519SecretSeed怎么用?TypeScript StrKey.decodeEd25519SecretSeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stellar-sdk.StrKey
的用法示例。
在下文中一共展示了StrKey.decodeEd25519SecretSeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: co
return co(function *() {
// The wallet will have 3 keychains on it, usually 2 of those are generated by the platform, and 1 is generated by the user.
// Initially, we need a root prv to generate the account, which has to be distinct from all three keychains on the wallet.
// If a root prv is not provided, we generate a random one.
let seed;
const rootPrv = walletParams.rootPrivateKey;
if (rootPrv) {
if (!this.isValidPrv(rootPrv)) {
throw new Error('rootPrivateKey needs to be valid ed25519 secret seed');
}
seed = stellar.StrKey.decodeEd25519SecretSeed(rootPrv);
}
const keyPair = this.generateKeyPair(seed);
// extend the wallet initialization params
walletParams.rootPrivateKey = keyPair.prv;
return walletParams;
}).call(this);