2023-10-11 23:36:14 +00:00
|
|
|
// Styles required for @cosmos-kit/react modal
|
|
|
|
import '@interchain-ui/react/styles'
|
|
|
|
|
|
|
|
import { GasPrice } from '@cosmjs/stargate'
|
|
|
|
import { wallets as keplrExtensionWallets } from '@cosmos-kit/keplr-extension'
|
2023-10-16 10:12:04 +00:00
|
|
|
import { wallets as leapExtensionWallets } from '@cosmos-kit/leap-extension'
|
2023-10-11 23:36:14 +00:00
|
|
|
import { ChainProvider } from '@cosmos-kit/react'
|
|
|
|
import { assets, chains } from 'chain-registry'
|
|
|
|
import { getConfig } from 'config'
|
|
|
|
import type { ReactNode } from 'react'
|
|
|
|
import { NETWORK } from 'utils/constants'
|
|
|
|
|
|
|
|
export const WalletProvider = ({ children }: { children: ReactNode }) => {
|
|
|
|
const { gasPrice, feeToken } = getConfig(NETWORK)
|
|
|
|
return (
|
|
|
|
<ChainProvider
|
|
|
|
assetLists={assets}
|
|
|
|
chains={chains}
|
|
|
|
signerOptions={{
|
|
|
|
signingCosmwasm: () => ({
|
|
|
|
gasPrice: GasPrice.fromString(`${gasPrice}${feeToken}`),
|
|
|
|
}),
|
|
|
|
signingStargate: () => ({
|
|
|
|
gasPrice: GasPrice.fromString(`${gasPrice}${feeToken}`),
|
|
|
|
}),
|
|
|
|
}}
|
2023-10-16 10:12:04 +00:00
|
|
|
wallets={[...keplrExtensionWallets, ...leapExtensionWallets]}
|
2023-10-11 23:36:14 +00:00
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</ChainProvider>
|
|
|
|
)
|
|
|
|
}
|