-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: Add support for Keplr #938
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -0,0 +1,9 @@ | |||
import { isMainnet } from './networks'; | |||
|
|||
export const OSMO_USDC_IBC_DENOM = isMainnet |
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.
[suggestion] i think right now we have a tokens
property in the v1/env
config where we define the dydx usdc ibc denom. would probably be worth adding into there in case we need it in other places later?
multiChain: true, | ||
}); | ||
|
||
const cosmosAddress = useMemo(() => { |
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.
consider moving this to useAccounts
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.
Hmm I see that this requires a chainId
to get the desired bech32. I think this does complicate whether we move it to useAccounts
. Maybe we only move the grazAccounts
hook and rename this to selectedChainAddress
instead of cosmosAddress
@@ -412,6 +412,13 @@ const useDydxClientContext = () => { | |||
return compositeClient?.validatorClient.get.getAllValidators(); | |||
}, [compositeClient]); | |||
|
|||
const getAccountBalance = useCallback( |
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.
Revisit if I can use the abacus account 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.
also consider renaming this
src/hooks/useAccountBalance.ts
Outdated
const { data: accounts } = useAccountGraz({ | ||
chainId: SUPPORTED_COSMOS_CHAINS, | ||
multiChain: true, | ||
}); | ||
|
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.
I think this should also be moved to the useAccounts hook with cosmosAddress
below
@@ -473,6 +673,9 @@ export const DepositForm = ({ onDeposit, onError }: DepositFormProps) => { | |||
if (depositStep === DepositSteps.Confirm) { | |||
return stringGetter({ key: STRING_KEYS.PENDING_DEPOSIT_CONFIRMATION }); | |||
} | |||
if (depositStep === DepositSteps.KEPLR_APPROVAL) { | |||
return 'Pending approval in wallet'; |
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.
todo: for localization
Branched off: #449
Add support for Keplr
With fixes and additional changes on top:
CosmosDepositDialog
depositToSubaccount
, and send the amount based on balance.Views
New:
<ViewComponentName>
<ViewComponentName>
→
Components
New:
<ComponentName>
<ComponentName>
→
Styles/Mixins
styles/_____
→
Constants/Types
constants/_____
Functions
lib/_____
Hooks
hooks/_____
State
state/_____
Packages
package-name
Workflows
workflow-name.yml