本文整理匯總了TypeScript中dpos-offline/dist/es5/liskWallet.LiskWallet.default方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript LiskWallet.default方法的具體用法?TypeScript LiskWallet.default怎麽用?TypeScript LiskWallet.default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dpos-offline/dist/es5/liskWallet.LiskWallet
的用法示例。
在下文中一共展示了LiskWallet.default方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: confirmTransactions
export const createRandomAccountWithFunds = async (howMany: number = 1000, recipientWallet: LiskWallet = createRandomWallet()) => {
const systemModule = initializer.appManager.container.get<ISystemModule>(Symbols.modules.system);
const senderWallet = getRandomDelegateWallet();
const t = new dposOffline.transactions.SendTx();
t.set('amount', howMany);
t.set('fee', systemModule.getFees().fees.send);
t.set('timestamp', 0);
t.set('recipientId', recipientWallet.address);
const tx = senderWallet.signTransaction(t);
await confirmTransactions([tx], true);
return {
delegate: senderWallet,
txID : tx.id,
wallet : recipientWallet,
};
};
示例2:
export const generateAccounts = (howMany: number): LiskWallet[] => {
const toRet = [];
for (let i = 0; i < howMany; i++) {
toRet.push(generateAccount());
}
return toRet;
};
示例3: Array
const keys = new Array(howMany).fill(null).map(() => createRandomWallet());
示例4: generateAccount
export const generateFakeAddress = (): string => {
return generateAccount().address;
};