Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 尝试使用Bitgo js发送ltc硬币_Node.js - Fatal编程技术网

Node.js 尝试使用Bitgo js发送ltc硬币

Node.js 尝试使用Bitgo js发送ltc硬币,node.js,Node.js,我想使用bitGo js api发送ltc,但它不是wokring,存在金额问题。它对btc有效,但对ltc无效。我尝试将金额转换为satoshi和litoshi,但直到它不起作用。以下是我的代码: const BitGoJS = require('../../src/index'); const bitgo = new BitGoJS.BitGo({ env: 'test' }); const Promise = require('bluebird'); const

我想使用bitGo js api发送ltc,但它不是wokring,存在金额问题。它对btc有效,但对ltc无效。我尝试将金额转换为satoshi和litoshi,但直到它不起作用。以下是我的代码:

 const BitGoJS = require('../../src/index');
    const bitgo = new BitGoJS.BitGo({ env: 'test' });
    const Promise = require('bluebird');

    const coin = 'tltc';
    const basecoin = bitgo.coin(coin);
    // TODO: set your access token here
    const accessToken = null;
    const walletId = '5941ce2db42fcbc70717e5a898fd1595';
    // TODO: set your passphrase here
    const walletPassphrase = null;

    Promise.coroutine(function *() {
      bitgo.authenticateWithAccessToken({ accessToken: accessToken });

      const walletInstance = yield basecoin.wallets().get({ id: walletId });

      const newReceiveAddress1 = yield walletInstance.createAddress();
      const newReceiveAddress2 = yield walletInstance.createAddress();

      const transaction = yield walletInstance.sendMany({
        recipients: [
          {
            amount: '12341234', //not getting how to convert the  amount here
            address: newReceiveAddress1.address
          },
],
        walletPassphrase: walletPassphrase
      });
      const explanation = basecoin.explainTransaction({ txHex: transaction.tx });

      console.log('Wallet ID:', walletInstance.id());
      console.log('Current Receive Address:', walletInstance.receiveAddress());
      console.log('New Transaction:', JSON.stringify(transaction, null, 4));
      console.log('Transaction Explanation:', JSON.stringify(explanation, null, 4));
    })();

请建议一些解决方案,如何解决在bitGo js中传递给api for send方法时的金额问题

问题是什么?发行数量意味着什么?你能在这里发布错误吗?如果我试图传递最小数量,它会给出灰尘值的错误,否则如果没有转换就传递了该值,则会出现thershold的错误