curve-stablecoin-js
curve-stablecoin-js copied to clipboard
DefiSaver integration: show user's safe position if available
If a user with a defisaver position connects to lend.curve.fi or crvusd.curve.fi, then impersonate a different wallet address (the safe address)
Defisaver API information:
API: https://app.defisaver.com/safe/all-wallets?account=[address]&network=[chainId]
Example: https://app.defisaver.com/safe/all-wallets?account=0xEA57Dc30959eb17c506E4dA095fa9181f3E0Ac6D&network=1
It returns both the legacy DSProxy wallets as well as the new Safe wallets. If user has a safe with multiple owners, then it is not necessarily a defisaver safe.