-
Notifications
You must be signed in to change notification settings - Fork 6
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: activity service #853
base: dev
Are you sure you want to change the base?
Conversation
@@ -7,12 +7,36 @@ import { | |||
} from './stacks-transactions.utils'; | |||
|
|||
export interface StacksTransactionsService { | |||
getTotalTransactions(address: string, signal?: AbortSignal): Promise<StacksTx[]>; |
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.
Do you think it would be good to accept token
here too? Then we would be able to get SIP-10 / Stacks only data for the Token view pages also directly from the service?
We can also search in the cache client side for that too but I'm not sure what would be the most efficient 🤔
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.
Yeah, good point. It might make sense to eventually separate out into individual asset activity services (similar to how balances are structured). So, there may end up being a different entry point (e.g. sip10ActivityService.getAllActivity(), sip10ActivityService.getTokenActivity(token)
), but yeah, I will try to support this kind of functionality via service call.
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.
Thanks @alexp3y 👏 separating into separate calls would be good but i think if we can pass a token it would help with further sub-categorisation of SIP-10's. For example if we are viewing our BANANA
/ TREMP
SIP-10's
This is awesome, thanks @alexp3y 👏 exactly what we need so the UI can keep light and just get |
}; | ||
export type TokenTransferDirection = keyof typeof TokenTransferDirections; | ||
|
||
export interface TokenTransferActivity extends BaseActivity { |
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 is perfect and is all the details we need for the UI
} | ||
|
||
export function useAccountActivityQuery(account: UnifiedAccountIdentifier) { | ||
const { fiatCurrencyPreference } = useSettings(); |
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.
Seeing this here now too and it's actually great to have gotten this done now as it will be pre-built for our next tasks from the start
@pete-watters Still working on this first pass at an activity service + queries but wanted to show my thinking here on how we could potentially unify transaction data under this base discriminable
Activity
model (per our conversation yesterday).