Skip to content

[nil.js] Make sendMessage in nil.js awaitable #173

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

Closed
knazarov opened this issue Feb 4, 2025 · 3 comments · Fixed by #661
Closed

[nil.js] Make sendMessage in nil.js awaitable #173

knazarov opened this issue Feb 4, 2025 · 3 comments · Fixed by #661
Assignees
Labels
niljs Related to niljs client library ODHack12 Tag for issues which are suitable for ODHack week

Comments

@knazarov
Copy link
Collaborator

knazarov commented Feb 4, 2025

Now we can receive recipe of transaction like this:

const hash = await wallet.sendMessage({
  to: anotherAddress,
  value: 10_000_000n,
  gas: 100_000n,
});

await waitTillCompleted(client, 1, hash);

There is a proposal to change api accordingly with the following example

const tx = await wallet.sendMessage({...});
await tx.waitTillCompleted();

sendMessage can return object what can be awaited. We need some testing and usability testing to prove this idea. Probably there are cases when await waitTillCompleted(client, 1, hash) is more convenient.

@knazarov knazarov added the niljs Related to niljs client library label Feb 4, 2025
@0xAleksaOpacic 0xAleksaOpacic added the ODHack12 Tag for issues which are suitable for ODHack week label Mar 19, 2025
@0xAleksaOpacic 0xAleksaOpacic changed the title Make sendMessage in nil.js awaitable [nil.js] Make sendMessage in nil.js awaitable Mar 19, 2025
@manassehO
Copy link
Contributor

Hi,

I’m Manasseh, and I’d like to work on this! I have 3 years of coding experience. I can make sendMessage awaitable, test the new tx.waitTillCompleted() idea, and check how it works compared to waitTillCompleted(client, 1, hash). I’ll add tests and try it out to prove it’s easy to use. Let me handle this. I’ll do it well!

Thanks,

Manasseh

@idea404
Copy link
Collaborator

idea404 commented Mar 21, 2025

Hey @manassehO thanks for indicating your interest in this issue. Happy to assign this issue to you. If you have any questions feel free to tag me, @0xAleksaOpacic or @gitshreevatsa in case of questions or reach us directly through our developer Telegram group which you can find here

@gitshreevatsa
Copy link
Collaborator

Hey @manassehO ! Hope you're doing well.

Just checking in — how's everything going with this issue? Let us know if you're stuck at any point or need help with anything.

If you're still planning to work on it, great! If not, no problem — just let us know so we can reassign and keep things moving.

Appreciate your time and effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
niljs Related to niljs client library ODHack12 Tag for issues which are suitable for ODHack week
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants