TRX转账

HTTP接口:

wallet/createtransaction
作用: 创建一个未签名的转账Transaction,如果转账的to地址不存在,则在区块链上创建该账号
示例: 
curl -X POST  https://api.shasta.trongrid.io/wallet/createtransaction -d '{"to_address": "41D3136787E667D1E055D2CD5DB4B5F6C880563049", "owner_address": "417946F66D0FC67924DA0AC9936183AB3B07C81126", "amount": 10000000 }'
参数说明:
to_address是转账转入地址,默认为hexString    
owner_address是转账转出地址,默认为hexString    
amount是转账数量,单位为sun    
可选参数Permission_id,多重签名时使用,设置交易多重签名时使用的permissionId         
返回值:Object

Tronweb示例

const privateKey = "..."; 
var fromAddress = "TM2TmqauSEiRf16CyFgzHV2BVxBejY9iyR"; //address _from
var toAddress = "TVDGpn4hCSzJ5nkHPLetk8KQBtwaTppnkr"; //address _to
var amount = 10000000; //amount
//创建一个未签名的TRX转账交易
tradeobj = await tronWeb.transactionBuilder.sendTrx(
      toAddress,
      amount,
      fromAddress
);
//签名
const signedtxn = await tronWeb.trx.sign(
      tradeobj,
      privateKey
);
//广播
const receipt = await tronWeb.trx.sendRawTransaction(
      signedtxn
).then(output => {
  console.log('- Output:', output, '\n');
  return output;
});

Wallet-cli示例 :

#用法: SendCoin [OwnerAddress]  [ToAddress]  [Amount(sun)]
SendCoin TWbcHNCYzqAGbrQteKnseKJdxfzBHyTfuh 100

请按照以下说明步骤完成本次交易:
1.提示:“Please confirm and input your permission id, if input y or Y means default 0, other non-numeric characters will cancel transaction.”,输入“y” 或是“Y”, 确认本次交易;
2.提示:“lease choose your key for sign. …… Please choose between 1 and 2”,选择签名账户的序号;
3.提示:“Please input your password.”,输入本地密码;
4.提示:“Send 100 Sun to TWbcHNCYzqAGbrQteKnseKJdxfzBHyTfuh successful !!” ,表示转账TRX成功。