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

Add example for RPC call to get current market info #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevjin
Copy link

@kevjin kevjin commented Jan 27, 2023

This way extensions can know what market the main app is currently on, and handle that for the extension properly (e.g. whether the market is currently set to "ETH" or "USDC")

We need to have a sync call for (requested) 'pull' messages via rpc.sendRPC and handle that resolved data.

  • This is necessary to make sure we send data after the extension app is loaded.
    We also need to have an async listener for (unprompted) 'push' messages, via rpc.on(...).
  • This is necessary in case the data from the main app gets updated, or if the user made an RPC request and the data wasn't ready yet (e.g. market data hasn't been loaded), but is ready at a later time.

@ajb413 ajb413 requested review from hayesgm and mykelp January 27, 2023 17:43
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.

1 participant