當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript liskWallet.LiskWallet類代碼示例

本文整理匯總了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;
};
開發者ID:RiseVision,項目名稱:rise-node,代碼行數:7,代碼來源:accountsUtils.ts

示例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));
};
開發者ID:RiseVision,項目名稱:rise-node,代碼行數:7,代碼來源:txCrafter.ts

示例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 }));
};
開發者ID:RiseVision,項目名稱:rise-node,代碼行數:22,代碼來源:utils.ts

示例4: Array

 const keys       = new Array(howMany).fill(null).map(() => createRandomWallet());
開發者ID:RiseVision,項目名稱:rise-node,代碼行數:1,代碼來源:utils.ts

示例5: generateAccount

export const generateFakeAddress = (): string => {
  return generateAccount().address;
};
開發者ID:RiseVision,項目名稱:rise-node,代碼行數:3,代碼來源:accountsUtils.ts


注:本文中的dpos-offline/dist/es5/liskWallet.LiskWallet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。