首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用bitgo发送xrp令牌

如何使用bitgo发送xrp令牌
EN

Stack Overflow用户
提问于 2018-07-19 06:42:54
回答 1查看 164关注 0票数 2
代码语言:javascript
复制
const BitGoJS = require(__dirname + '/BitGoJS/src/index.js');
const bitgo = new BitGoJS.BitGo({ env: 'test' });

const Promise = require('bluebird');
const coin = 'txrp';
const basecoin = bitgo.coin(coin);
// TODO: set your access token here
const accessToken = 'xxxxxxxxxx';
const walletId = 'xxxxxxxxxx';
// TODO: set your passphrase here
const walletPassphrase = 'xxxxxxxxxxxx';

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

    bitgo.unlock({ otp: '0000000' }).then(function(unlockResponse) {
    });    
    let user_walletId    =  'xxxx';
        const walletInstance = yield basecoin.wallets().get({ id: walletId });
        const wallet         = yield basecoin.wallets().get({ id: user_walletId });
    const newReceiveAddress1 = wallet.receiveAddress();
    console.log('receiveAddress is :'+newReceiveAddress1);
    console.log('Balance is: ' + (walletInstance.balance() / 1e8).toFixed(4));
    const transaction = yield walletInstance.sendMany
    ({
        recipients: [
        {  
        amount:  '0.1' * 1e8,           
        address: newReceiveAddress1 
        },
],
walletPassphrase: walletPassphrase
       });  
        const explanation = basecoin.explainTransaction({ txHex: transaction.tx });  
    console.log(transaction.tx);

})();

我无法发送xrp令牌。在未处理的拒绝错误下面显示错误:无法读取未定义requestId=cjjs6t6242xd1p9rx1h5u9lch的属性“nonNumericString”

EN

回答 1

Stack Overflow用户

发布于 2018-07-27 10:59:40

您必须将您的金额修改为有效字符串。bitgo不接受'8000.0',您必须删除字符串的分数部分。因此,有效金额是'8000'

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51415981

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档