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

Utility function to wait a websocket to return transaction information #4

Open
melanke opened this issue Jul 21, 2021 · 0 comments
Open

Comments

@melanke
Copy link

melanke commented Jul 21, 2021

@hal0x2328 made a websocket service on Dora that is very useful: It simply send a single message with transaction information right when it gots it and then it closes the websocket connection.

This is very useful because after a invokefunction is important to be sure if the transaction was successful and which information was sent via notification by the smart contract, so, you could do something like this:

const resp = await walletConnectCtx.invokeFunction(scripthash, method, params)
const transaction = await dora.waitForTransaction(resp.result) // new method to open, listen and close a websocket
const notifications = transaction.filterNotifications(scripthash, eventname) // new method to make it easier to get a notification

I believe the endpoint of the Websocket is:
wss://dora.coz.io/ws/v1/neo3/testnet/log/<transaction_id>

I would be happy to implement this issue, but probably there is a lot of decisions to be made regarding the responses of those methods

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