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

api returns assets without metadata #123

Merged
merged 5 commits into from
Feb 16, 2024
Merged

api returns assets without metadata #123

merged 5 commits into from
Feb 16, 2024

Conversation

n00m4d
Copy link
Contributor

@n00m4d n00m4d commented Feb 9, 2024

What

This PR add ablity to the API to return assets without off chain metadata

UPD

Also this PR adds updating ownership model row and returning FungibleAsset and FungibleToken interfaces when it's required, previously it was returning Custom interface value

@n00m4d n00m4d changed the title feat: api returns assets without metadata api returns assets without metadata Feb 9, 2024
@StanChe
Copy link
Collaborator

StanChe commented Feb 9, 2024

This one is fixing the get asset endpoint. We'll also need to partially revert #40 for the other endpoints, but we may keep it as a separate effort

let (save_values, owner_type_update) =
mint_accs_to_save.to_owned().clone().into_iter().fold(
(HashMap::new(), HashMap::new()),
|mut acc: (HashMap<_, _>, HashMap<_, _>), mint| {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest having 2 named hashmaps here to improve readability

None,
OwnerType::Single,
),
owner_type: Updated::default(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a correct assumption that we need slot_updated == 0 and ownertype == unknown for token accounts? I'm not following the logic with the zero slot_updated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OwnerType field will be updated during Mint account processing, transform_and_save_mint_accs() method. During token account update we should not change that value. It's implemented this way because value of OwnerType depends on supply of mint account, during token account update we don't have this info

@n00m4d n00m4d merged commit 65da47b into main Feb 16, 2024
1 check passed
@n00m4d n00m4d deleted the fix/empty-metadata branch February 16, 2024 12:05
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

Successfully merging this pull request may close these issues.

3 participants