Node.js 尝试使用Bitgo js发送ltc硬币
我想使用bitGo js api发送ltc,但它不是wokring,存在金额问题。它对btc有效,但对ltc无效。我尝试将金额转换为satoshi和litoshi,但直到它不起作用。以下是我的代码: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
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的错误