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

Fix FT events & NEP-297 API improvements #63

Merged
merged 4 commits into from Sep 22, 2022

Conversation

encody
Copy link
Member

@encody encody commented Sep 21, 2022

Fixes #62

@encody encody linked an issue Sep 21, 2022 that may be closed by this pull request
@encody
Copy link
Member Author

encody commented Sep 21, 2022

Ok now that I'm thinking about it, maybe this could have all been averted by just using a Vec with indirection for the events, like I had in one of the examples. I forgot about that.

#[derive(Serialize)]
pub struct Nep171NftMintData {
    pub owner_id: String,
    pub token_ids: Vec<String>,
}
#[event(standard = "nep171", version = "1.0.0")]
pub enum Nep171 {
    NftMint(Vec<Nep171NftMintData>),
}
let my_event = Nep171::NftMint(vec![Nep171NftMintData {
    owner_id: "owner".to_string(),
    token_ids: vec!["token_1".to_string(), "token_2".to_string()],
}]);

@encody
Copy link
Member Author

encody commented Sep 21, 2022

A lot of these changes make for a better API, definitely, but maybe the batch isn't necessary.

@encody encody changed the title Batch events Batch FT events & NEP-297 API improvements Sep 22, 2022
@encody encody changed the title Batch FT events & NEP-297 API improvements Fix FT events & NEP-297 API improvements Sep 22, 2022
@encody encody merged commit b85aa62 into develop Sep 22, 2022
@encody encody deleted the 62-nep-141-events-are-not-in-an-array branch September 22, 2022 06:45
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.

NEP-141 events are not in an array
2 participants