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

Mint and Token Confusion #456

Closed
CyberCyclone opened this issue Mar 21, 2021 · 2 comments
Closed

Mint and Token Confusion #456

CyberCyclone opened this issue Mar 21, 2021 · 2 comments
Assignees

Comments

@CyberCyclone
Copy link

The way the queries and tables were created is causing confusion in what they do.

E.g, When using Hasura I can see that there's a table called "Mint" which shows all the tokens that have been minted. Can we please have this exposed to GraphQL? As far as I can see, there isn't a reliable way of retrieving all the minted tokens with the correct quantities while using the "token" interface/table. E.g, you can do a distinct, but you can't order it by includedAt, so any selected "distinct" isn't guaranteed to be the minted transaction. Exposing "Mint" would solve this.

GraphQL has the "tokens" table exposed however this isn't a unique set of tokens and is actually all the transactions that have happened against a token. I feel like it would be more appropriate to call it token_transactions and token_transactions_aggregate.

@rhyslbw
Copy link
Contributor

rhyslbw commented Mar 22, 2021

Yes you're right @CyberCyclone , the mint table holds the information we need to determine the supply.

I feel like it would be more appropriate to call it token_transactions and token_transactions_aggregate.

I'll sleep on it and work something out. We may be better off removing this query since it's associated via the transactions
directly, and the most natural way to know what tokens are in existence is via the UTxO set. Having access to a query that can aggregate the mint table data is the key improvement here.

Thanks again

@rhyslbw rhyslbw self-assigned this Mar 22, 2021
rhyslbw added a commit that referenced this issue Mar 23, 2021
- Renames the Mint SQL VIEW to TokenMint
- Renames the Token SQL VIEW to TokenInOutput,
however there are no changes to the exposed GraphQL model,
with TransactionOutput.tokens.
- Uses the ma_tx_mint rather than ma_tx_out table for building
the Asset table on startup
- Also adds missing field params to Transaction.mint
Closes #456
@CyberCyclone
Copy link
Author

The approach in the release of 4.0.0 works a lot better now. Thanks!

rhyslbw added a commit that referenced this issue Apr 6, 2021
- Renames the Mint SQL VIEW to TokenMint
- Renames the Token SQL VIEW to TokenInOutput,
however there are no changes to the exposed GraphQL model,
with TransactionOutput.tokens.
- Uses the ma_tx_mint rather than ma_tx_out table for building
the Asset table on startup
- Also adds missing field params to Transaction.mint
Closes #456
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

2 participants