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

Transfer modal: status indicator #789

Closed
victortokaito opened this issue Sep 12, 2022 · 2 comments
Closed

Transfer modal: status indicator #789

victortokaito opened this issue Sep 12, 2022 · 2 comments

Comments

@victortokaito
Copy link
Contributor

Problem

IBC status indicators on info.osmosis.zone are useful, but not easily discoverable because they're accessed offsite.

Solution

Implement "just-in-time" ibc status indicators on the transfer modal:

  • This information comes to the user right at the step it becomes relevant to them (at least on the osmosis app). Indicators' utility improves along with its relevance by helping users understand why transactions may be slowed.
  • The animation transforms to match the error code (using new design guidelines’ negative gradient to indicate network is congested).

https://www.figma.com/file/qze5yJO9TEw7vysInR07Ui?node-id=1832:113709#262708753

@jonator
Copy link
Member

jonator commented Oct 27, 2022

Our current solution:

https://info.osmosis.zone/ibc

We'd like to add this to our app at the right moment in user workflow.

Though we may want to use a more specific query, see:
https://api-osmosis.imperator.co/swagger/#/ibc

Perhaps:
https://api-osmosis.imperator.co/ibc/v1/source/osmosis/destinationjuno?minutes_trigger=-1
Where minutes_trigger is the amount of time the channel has been clogged. We could decide on a reasonable value for that.

@jonator
Copy link
Member

jonator commented Oct 28, 2022

Tips/Gameplan

Query

In the stores package, add a new query object here:

constructor(
kvStore: KVStore,
feeMetricsBaseURL = "https://api-osmosis.imperator.co"
) {
this.queryGammPoolFeeMetrics = new ObservableQueryPoolFeesMetrics(
kvStore,
feeMetricsBaseURL
);
}

It should extend a HasMapStore (example) mapping counterPartyChainId -> ObservableQueryIbcStatus, perhaps called ObservableQueryIbcStatuses. See ObservableQueryPoolFeesMetrics class for an example of querying external APIs as mobx stores. The store you implement for a single counterparty status should contain a computed property that reads the query result and returns a nice high-level type that returns the state of the current channel, such as Congested or Blocked (could be string literals: example). The root map store may need to accept parameters (with defaults) to define the number of pending transactions for any channel to be considered congested and blocked. It will pass this info to the mapped stores.

View

  1. Back in the web package, in the IBC transfer modal component, import the queriesExternalStore from the root store.

    const { chainStore, queriesStore, ibcTransferHistoryStore } = useStore();

  2. Somewhere in the body of the component, call .get(counterpartyChainId) to get a query object for a particular IBC counterparty. On that object, you should be able to call .status or something and get a high level status of the current channel.

  3. Use that result to update the view according to the Figma.

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 a pull request may close this issue.

2 participants