-
Notifications
You must be signed in to change notification settings - Fork 14
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
Accounts updated subscription #302
base: main
Are you sure you want to change the base?
Accounts updated subscription #302
Conversation
The You can open the |
tokio_stream::wrappers::BroadcastStream::new(self.block_added.resubscribe()) | ||
} | ||
|
||
async fn accounts_updated( |
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.
The query at the front-end includes an additional accountAddress
query variable:
{
"id": "1",
"type": "start",
"payload": {
"key": "...",
"query": "subscription accountsUpdatedSubscription($accountAddress: String!) {\n accountsUpdated(accountAddress: $accountAddress) {\n address\n }\n}",
"variables": {
"accountAddress": "4dT5vPrnnpwVrXZgmYLtHrDLvBYhtzheaK4fDWbJewqRCGQKWz"
},
"context": {
"url": "https://api-ccdscan.testnet.concordium.com/graphql",
"preferGetMethod": false,
"suspense": false,
"requestPolicy": "cache-first",
"meta": {
"cacheOutcome": "miss"
}
}
}
}
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.
Right - but what am I supposed to do with that input string? 🤔
In the C# code, it seems it's the "topic" of the subscription? Not sure what that means.
public class Subscription
{
[Subscribe]
[Topic("{accountAddress}")]
public AccountsUpdatedSubscriptionItem AccountsUpdated(
string accountAddress,
[EventMessage] AccountsUpdatedSubscriptionItem message) => message;
[Subscribe]
public Block BlockAdded([EventMessage] Block block) => block;
}
Purpose
I'm honestly not sure where this is used in the frontend.
Changes
Added the
AccountsUpdatedSubscriptionItem
and the appropriate methods toSubscription
, which are largely inspired by the already-existingblock_added
subscription.What's missing is actually sending the notifications when the appropriate event happens - this is left for future work.
Checklist
hard-to-understand areas.