本文整理匯總了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;
};