-
Notifications
You must be signed in to change notification settings - Fork 381
Conversation
|
||
import { AirswapAppDefinition } from './airswap.definition'; | ||
import { AirswapContractFactory } from './contracts'; | ||
import { EthereumAirswapBalanceFetcher } from './ethereum/airswap.balance-fetcher'; |
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.
Is airswap.balance-fetcher necessary? Since airswap tokens are already shown on dashboard.
const contract = this.airswapContractFactory.staking({ address, network }); | ||
const balance = await contract.balanceOf(account); | ||
|
||
return [balance]; |
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.
Not sure what to do here. How to properly return the balance?
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.
Hey @piersss !
The EthereumAirswapSAstTokenFetcher
class should simply be returning an AppTokenPosition
that represents the sAST
token. You can follow along here for details.
Once you read that, you'll see that:
- You'll need to build your
AppTokenPosition
forsAST
withAST
as an underlying token - Your
pricePerShare
would be1
since users mintsAST
in a 1:1 ratio with depositedAST
Then, you can update your EthereumAirswapBalanceFetcher
class following along here. The BalanceFetcher
receives the user account as you mentioned above.
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.
Thank you @immasandwich . Making progress here.
Everything looks fine in http://localhost:5001/apps/airswap/balances?addresses[]=<ADDRESS>&network=ethereum
. Is there a way to test the dashboard and see if sAST shows up?
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.
Not yet unfortunately! But we're quite confident in it working correctly if you're correct on the types being returned.
Looks good to me! Just a few more things:
- Add the Airswap logo (the AST token image) in
airswap/assets/logo.png
- Delete the
yarn.lock
file you generated (we usepnpm-lock.json
instead, see https://pnpm.io/)
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.
Once that's good, we'll merge and do a Studio release, and we'll consume the latest version in Zapper API.
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.
Fixed your feedback, thanks.
The types returned looks correct. It returns the sAST with AST as underlying token.
Description
Trying to add staked airswap (sAST) to the project. Tutorial was very helpful, but I still have some questions.
Checklist
How to test?
http://localhost:5001/apps/airswap/tokens?groupIds[]=s-ast&network=ethereum