Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

fix(solace): Adjust Solace implementation #472

Merged
merged 2 commits into from
May 20, 2022
Merged

Conversation

immasandwich
Copy link
Contributor

@immasandwich immasandwich commented May 20, 2022

Description

For Solace team to review:

  • Linting/Prettier was off; if you're using VSCode, use the project ESLint/Prettier settings and use the available VSCode plugins.
  • Logo needs to be a .png
  • Use range method from lodash rather than declaring your own
  • Remove inferred types from arrow definitions, and use constants:
-const stakedToken = contractPosition.tokens.find((t:WithMetaType<Token>) => t.metaType === 'supplied')!;
+const stakedToken = contractPosition.tokens.find(t => t.metaType === MetaType.SUPPLIED)!;
  • In findTokens, we were "building" the app specific token. Instead, you can use this.appToolkit.getAppTokenPositions to get the tokens from another existing group, like so:
const appTokens = await this.appToolkit.getAppTokenPositions({
  appId,
  groupIds: [SOLACE_DEFINITION.groups.scp.id],
  network,
});
  • Similarly, for SLP, we'd need to pull tokens from the SushiSwap Pools group.
const appTokens = await this.appToolkit.getAppTokenPositions({
  appId: 'sushiswap',
  groupIds: ['pool'],
  network,
});
  • After the above two points were addressed, I was able to remove the findTokens helper entirely.
  • Always assume the base token match is defined if its found in the list here, so you can use the non-null assertion ! on the results of baseTokens.find.

Checklist

How to test?

@immasandwich immasandwich merged commit cdd243d into main May 20, 2022
@immasandwich immasandwich deleted the solace-adjustments branch May 20, 2022 13:34
dominikpre pushed a commit to EaseDeFi/ease-zapper-integration that referenced this pull request May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant