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

Remove redundant method from Route interface #736

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

artursapek
Copy link
Collaborator

@artursapek artursapek commented Nov 12, 2024

isProtocolSupported is redundant with supportedChains. We should keep the Route interface as small as possible to make it easy for plugins to be written. This reduces the interface to four consistent methods, which I think is cleaner:

  supportedNetworks(): Network[];

  supportedChains(network: Network): Chain[];

  supportedSourceTokens(fromChain: ChainContext<Network>): Promise<TokenId[]>;

  supportedDestinationTokens<N extends Network>(
    token: TokenId,
    fromChain: ChainContext<N>,
    toChain: ChainContext<N>,
  ): Promise<TokenId[]>;

@artursapek artursapek merged commit dd576e0 into main Nov 12, 2024
1 check passed
@artursapek artursapek deleted the remove-is-protocol-supported branch November 12, 2024 16:14
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.

2 participants