We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is on "web3": "^1.0.0-beta.30"
"web3": "^1.0.0-beta.30"
So I have a helper function
const transferToken = (...) => { const p = contract.methods.transfer(...).send(...); console.log(p); return p; } transferToken(...)
p is logged as (note that on is listed as a function here):
p
on
Promise { _bitField: 0, _fulfillmentHandler0: undefined, _rejectionHandler0: undefined, _promise0: undefined, _receiver0: undefined, _trace: CapturedTrace { _parent: undefined, _promisesCreated: 0, _length: 1, _promiseCreated: null }, _events: { transactionHash: EE { fn: [Function: bound log], context: [Circular], once: false } }, emit: [Function: emit], on: [Function: on], once: [Function: once], off: [Function: removeListener], listeners: [Function: listeners], addListener: [Function: on], removeListener: [Function: removeListener], removeAllListeners: [Function: removeAllListeners] }
However if I do
const transferToken = (...) => { const p = contract.methods.transfer(...).send(...); return p; } const returnedP = transferToken(...) console.log(returnedP);
returnedP logs as:
returnedP
Promise { <pending> }
And I can't call returnedP.on(...). Basically the function doesn't seem to return the PromiEvent to me, instead it seems to return a pending Promise.
returnedP.on(...)
The text was updated successfully, but these errors were encountered:
Actually nvm, my issue was that I had const transferToken = async (...) => {...}
const transferToken = async (...) => {...}
Sorry, something went wrong.
No branches or pull requests
This is on
"web3": "^1.0.0-beta.30"
So I have a helper function
p
is logged as (note thaton
is listed as a function here):However if I do
returnedP
logs as:And I can't call
returnedP.on(...)
. Basically the function doesn't seem to return the PromiEvent to me, instead it seems to return a pending Promise.The text was updated successfully, but these errors were encountered: