本文整理汇总了TypeScript中nem-library.SimpleWallet.writeWLTFile方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SimpleWallet.writeWLTFile方法的具体用法?TypeScript SimpleWallet.writeWLTFile怎么用?TypeScript SimpleWallet.writeWLTFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nem-library.SimpleWallet
的用法示例。
在下文中一共展示了SimpleWallet.writeWLTFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Date
const downloadWallet = (wallet: SimpleWallet) => {
console.log(white(`\n\nDownloading wallet for your convenience.\n\nPlease store someplace safe. The private key is encrypted by your password.\n\nTo load this wallet on a new computer you would simply import the .wlt file into this app and enter your password and you'll be able to sign transactions.
`));
if (!fs.existsSync(PATH_HOME)) {
fs.mkdirSync(PATH_HOME);
}
let fullPath = PATH_WALLET;
if (fs.existsSync(fullPath)) {
const stamp = new Date().toISOString();
fullPath = `${PATH_HOME}/${stamp}-${MOSAIC_NAME}-wallet.wlt`
}
fs.writeFileSync(fullPath, wallet.writeWLTFile());
console.log(green(`Downloaded wallet to ${fullPath}`))
};