1
TypeError: Cannot read property '1' of undefined
at /mnt/d/Ayan Ali/Fiverr/TestingBooth/node_modules/bigchaindb-driver/dist/node/transaction.js:231:41
at Array.map (<anonymous>)
at Function.makeTransferTransaction (/mnt/d/Ayan Ali/Fiverr/TestingBooth/node_modules/bigchaindb-driver/dist/node/transaction.js:223:54)
at combineTokens (/mnt/d/Ayan Ali/Fiverr/TestingBooth/transtokenunify.js:214:46)
at /mnt/d/Ayan Ali/Fiverr/TestingBooth/transtokenunify.js:138:7
at processTicksAndRejections (internal/process/task_queues.js:95:5)

调用此函数时出现此错误

  transaction1,
  outputIndex1,
  transaction2,
  outputIndex2,
  totalTokens
) => {
  const bestFriend = new driver.Ed25519Keypair();
  const combineTransfer = driver.Transaction.makeTransferTransaction(
    [
      {
        tx: transaction1,
        output_index: outputIndex1,
      },
      {
        tx: transaction2,
        output_index: outputIndex2,
      },
    ],
    // Output
    [
      driver.Transaction.makeOutput(
        driver.Transaction.makeEd25519Condition(bestFriend.publicKey),
        totalTokens.toString()
      ),
    ],
    {
      transfer_to: "my best friend",
    }
  );

  // Sign the transaction with the newUser key
  const signedTransfer = await driver.Transaction.signTransaction(
    combineTransfer,
    privateKey
  );

  return conn.postTransactionCommit(signedTransfer);
};

官方文档中也有类似的功能: https ://www.bigchaindb.com/developers/guide/tutorial-token-launch/

4

0 回答 0