Questions tagged [tronweb]

55 questions
2
votes
3 answers

How to call balanceOf() method for non published ABI

I'm trying to call balanceOf() method on a specific Tron contract (TYukBQZ2XXCcRCReAUguyXncCWNY9CEiDQ), but what I get is Failed to execute . If I do not provide the parameters I get Invalid argument count provided - meaning at some level it works…
halaprix
  • 73
  • 6
2
votes
2 answers

Can't access window object property in Nuxt (Vue) mounted

I have a TronLink chrome extension, this extension provides a window.tronWeb property and I want to access this property after document load. I am trying to do that in the mounted() section of my Nuxt page component: // ... mounted() { …
Dmytro Zarezenko
  • 10,526
  • 11
  • 62
  • 104
1
vote
0 answers

Solidity Smart Contract on Tron - error on get contract with tronWeb

I've developed a Smart Contract on Tron ShastaNet. A previous similar contract was generated, and using it with tronWeb I don't have any issue. With this new contract, I got this error on Browser Console: TypeError: Cannot read properties of null…
Klode
  • 353
  • 3
  • 18
1
vote
1 answer

tronweb : how to get return value using tronweb contract send function

let contract = await window.tronWeb.contract().at(config.contract); let result = await contract.methods.depositTron() .send({callValue:amount*1000000}) .then(output=>transaction = output); console.log("result", result); I tried to get the result…
Alexsander
  • 11
  • 2
1
vote
0 answers

How to get multiple account balances in trc20 network

I'm developing a dapp with node.js and i have several wallets that I need to check their balances in a short amount of time. when I make a for loop in my wallet addresses and check them individually. I get 503 error from tronweb(I have tried the API…
Erfan Poursina
  • 119
  • 1
  • 4
  • 8
1
vote
1 answer

How do I listen for trx events on tron network? (Tronweb) nodejs

I already know that with this method "tronweb.contract().at(contractAddress).Transfer.watch()" I can listen to transfer events of a specific contract, but what I don`t know is that how can I listen for TRX intself?
ADLZ
  • 75
  • 1
  • 4
1
vote
0 answers

I want my smart contract to work with USDT

Im implementing a smart contract but i want every payable transaction work with USDT. My contract is working fine but its working with TRX. Im using tronweb to interact with it from FrontEnd. I tried using tokenid: on send parameter, but i found…
1
vote
2 answers

Tron transactionBuilder error Cannot read property 'address' of undefined

I am getting this type of error Cannot read property 'address' of undefined while i am calling sendTRX function { const privateKey = "***"; var fromAddress = window.tronWeb.address.toHex("TR18f2revPbnb9dzFTqYQ5TKaBjX1QEtsC"); //address _from var…
1
vote
1 answer

Await TronWeb send function to finish

Hi Im new in tron so I have succefully implemented read functions in smartcontract and also write but the issue im facing is how do I wait for the transaction to finish so I can display its result in tronWeb. I do know how to do it in ethereum 0.x &…
1
vote
0 answers

sha3 with option hex encoding vs non hex encoding with escaped string

I was trying to figure out why sha3("\x80") is different from sha3("0x80", {encoding:'hex'} ) web3.sha3( "\x80" ) "0x0f50dcb7f76b82d3cf8c843adacd5cb4d1ce1b6de2ef1f2557f196d07c26f08e" web3.sha3( "0x80" , { encoding : 'hex' }…
tensaix2j
  • 462
  • 6
  • 18
1
vote
1 answer

TypeError: contract.test is not a function tronweb nodejs

I am trying to access Tron smart contract which is deployed on the Shasta test network using Tron-Web. I am using node-casiko server Following is my code: const TronWeb = require('tronweb') // This provider is optional, you can just use a url for…
Varsh
  • 413
  • 9
  • 26
1
vote
1 answer

How to get the current active account in tronlink using tronweb?

I'm trying to access the current logged in tronlink account to make an authentication using tronlink for my dapp. Using metamask and web3 i can get the current active account on MetaMask using: const userPublicAddress = web3.eth.coinbase What's the…
Marcelo Fonseca
  • 1,705
  • 2
  • 19
  • 38
0
votes
1 answer

Sending USDT in testnet -- always "out of energy"

On my account in Shasta I have 5k TRX and the same amount of USDT. I'm trying to send USDT. So far it's failed with a result Failed -Out of Energy. For instance: async function transferTronTRC20Token(amount, privateKey, contractAddress) { let url…
0
votes
0 answers

TronWeb: mnemonics or private key?

I have a few beginner's questions to you: Why do we need mnemonics if all accounts are restored on instantination of tron web instance through passing the private key? What is 0th account which is returned after the tronWeb.createRandom() is…
Kirill
  • 55
  • 1
  • 5
0
votes
0 answers

How to implement TronLink wallet connect in a React project?

I'm trying to implement TronLink wallet connect in my React project using the TronWeb library. I tried TronWeb documentation, but not able to find good resource to start for React. I tried to create TronWeb instance using the samples in the…