如何将 TRX 发送到 tronlink web 中的智能合约功能

How to send TRX to a smart contract function in tronlink web

如何将tron发送到tronlink web中的智能合约功能。 我正在尝试以下方法,但没有用。

var contract = await tronweb.contract().at('{{env('CONTRACT_ADDRESS')}}')
await contract.Invest({{session('member_id')}}).address.send(amount);

它正在调用智能合约功能,但没有发送 tron。

callValue - 通过此交易转移到合约的 SUN 数量。 (1TRX = 1,000,000 太阳)

await contract.Invest({{session('member_id')}}).send({callValue: amount})

你可以查看 tronweb documentation 中的 send() 参数。