Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't send a token #59

Closed
cryptofuture opened this issue Nov 1, 2019 · 2 comments
Closed

Couldn't send a token #59

cryptofuture opened this issue Nov 1, 2019 · 2 comments

Comments

@cryptofuture
Copy link

cryptofuture commented Nov 1, 2019

Couldn't send a token. What the catch here?

const tronWeb = new TronWeb({
    fullHost: 'https://api.trongrid.io',
    solidityNode: 'https://api.trongrid.io',
    eventServer: 'https://api.trongrid.io'
})
tx = tronWeb.trx.sendTransaction("TQ5vcDELdXvzXszWXyM97Bq61aVT6qWwUw", 1, "WIN", "87a909d4ad639a936dc266a60b540d43dc730f6e22a5c726486cbbaf363507ec")
console.log(tx)

Output:

Promise { <pending> }
(node:30057) UnhandledPromiseRejectionWarning: TypeError: i is not a function
    at e.<anonymous> (/node_modules/tronweb/dist/TronWeb.node.js:1:81389)
    at tryCatch (/node_modules/regenerator-runtime/runtime.js:45:40)
    at Generator.invoke [as _invoke] (/node_modules/regenerator-runtime/runtime.js:271:22)
    at Generator.prototype.<computed> [as throw] (/node_modules/regenerator-runtime/runtime.js:97:21)
    at asyncGeneratorStep (/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _throw (/node_modules/@babel/runtime/helpers/asyncToGenerator.js:29:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:30057) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:30057) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

P.S: I'm aware about shasta, but amount on the account is small, so I'm not scared to actually lose it.
Account is: https://tronscan.org/#/address/TFEmx2iyqhoKV9BYvyfqhqrJMZDuFwedw1

@cryptofuture
Copy link
Author

Looks like doc is incorrect and correct function is sendToken
https://developers.tron.network/docs/tronweb-trx-functions#section-send-token
https://github.com/TRON-US/tronweb/blob/3ab10ff8c604cae580509bec58f9437caef6aca9/src/lib/trx.js#L914

But responce fails with {"Error":"class org.tron.core.exception.ContractValidateException : No asset !"} for me

@cryptofuture
Copy link
Author

Judging by function's code, it works only for trc10 tokens, makes sense now. Doc is incorrect through

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant