本文整理汇总了TypeScript中dpos-offline/dist/es5/liskWallet.LiskWallet类的典型用法代码示例。如果您正苦于以下问题:TypeScript LiskWallet类的具体用法?TypeScript LiskWallet怎么用?TypeScript LiskWallet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LiskWallet类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
export const generateAccounts = (howMany: number): LiskWallet[] => {
const toRet = [];
for (let i = 0; i < howMany; i++) {
toRet.push(generateAccount());
}
return toRet;
};
示例2:
export const createMultiSigTX = (from: LiskWallet, fee: number, obj: any = {}): ITransaction => {
const t = new dposOffline.transactions.MultiSignatureTx(obj.asset)
// .withRecipientId(from.address)
.withTimestamp(0);
Object.keys(obj).forEach((k) => t.set(k as any, obj[k]));
return from.signTransaction(t.withFees(fee));
};
示例3: async
export const createRandomAccountsWithFunds = async (howManyAccounts: number, amount: number): Promise<Array<{ tx: ITransaction, account: LiskWallet, senderWallet: LiskWallet }>> => {
const systemModule = initializer.appManager.container.get<ISystemModule>(Symbols.modules.system);
const senderWallet = getRandomDelegateWallet();
const txs = [];
const accounts: LiskWallet[] = [];
for (let i = 0; i < howManyAccounts; i++) {
const randomRecipient = createRandomWallet();
const t = new dposOffline.transactions.SendTx();
t.set('amount', amount);
t.set('fee', systemModule.getFees().fees.send);
t.set('timestamp', 0);
t.set('recipientId', randomRecipient.address);
const signedTx = senderWallet.signTransaction(t);
txs.push(signedTx);
accounts.push(randomRecipient);
}
await confirmTransactions(txs, false);
return txs
.map((tx, idx) => ({ tx, account: accounts[idx], senderWallet }));
};
示例4: Array
const keys = new Array(howMany).fill(null).map(() => createRandomWallet());
示例5: generateAccount
export const generateFakeAddress = (): string => {
return generateAccount().address;
};