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

Make TxReceipt polymorphic #92

Open
ndzik opened this issue Oct 4, 2021 · 1 comment
Open

Make TxReceipt polymorphic #92

ndzik opened this issue Oct 4, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ndzik
Copy link
Contributor

ndzik commented Oct 4, 2021

Currently this is required:

		const tx = await session.mint(nftAddress, nftId);
		const minttx = tx.tx as Mint;

I think it would be nice to have a polymorphic TxReceipt<T extends Transaction> helper, which types the internal transaction:

		const minttx: TxReceipt<Mint> = await session.mint(nftAddress, nftId);

This can then be set in the return values of our interfaces and should be straight forward to implement.

@sebastianst
Copy link
Contributor

sebastianst commented Oct 11, 2021

I like the idea of creating a templated type-safe TxReceipt type. But I think that it is still better to have two separate fields tx for the transaction and deltas for the modified deltas.

@sebastianst sebastianst added the enhancement New feature or request label Oct 11, 2021
@sebastianst sebastianst added this to the 21-10-22 milestone Oct 11, 2021
@sebastianst sebastianst removed this from the 21-10-22 milestone Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants