-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(publisher): Add an example of streaming contract events. DS-64 #224
base: main
Are you sure you want to change the base?
Conversation
ad7ef56
to
7fab01c
Compare
7fab01c
to
0948910
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff!
let mut receipt_stream = fuel_streams::Stream::<Receipt>::new(client).await; | ||
|
||
receipt_stream.with_filter( | ||
ReceiptsBurnSubject::new().with_contract_id(Some(contract_id.into())), | ||
); | ||
receipt_stream.with_filter( | ||
ReceiptsCallSubject::new().with_from(Some(contract_id.into())), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be better from a readability standpoint:
let mut receipt_stream = fuel_streams::Stream::<Receipt>::new(client).await; | |
receipt_stream.with_filter( | |
ReceiptsBurnSubject::new().with_contract_id(Some(contract_id.into())), | |
); | |
receipt_stream.with_filter( | |
ReceiptsCallSubject::new().with_from(Some(contract_id.into())), | |
); | |
let mut receipt_stream = fuel_streams::Stream::<Receipt>::new(client).await; | |
let receipt_stream = receipt_stream.with_filter( | |
ReceiptsBurnSubject::new().with_contract_id(Some(contract_id.into())), | |
).with_filter( | |
ReceiptsCallSubject::new().with_from(Some(contract_id.into())), | |
). | |
// other with_filters come here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about transactions and other resources from a specific contract id? You can use the by_id
subject to add examples too.
No description provided.