Conversation
- @cosmology/connect-chain@0.16.4
- @cosmology/connect-chain@0.16.5 - @cosmology/connect-multi-chain@0.16.2
update copy for templates
add build:dev and docs
…ulti-chain-style fix: upgrade deps and fix multi chain dropdown
…-kit-cosmjs upgrades
skylinezum
left a comment
There was a problem hiding this comment.
change the || operator to ?? to allow 0 values in balance components.
| <HStack w="256px" py={2} fontSize="13px" justify="space-between"> | ||
| <Flex gap={1}> | ||
| <Text fontWeight="semibold"> | ||
| Balance: {osmoBalance?.amount || '--'} |
There was a problem hiding this comment.
.amount == 0 will set balance to --. Change to ?? coalescing nullish.
There was a problem hiding this comment.
ok , {osmoBalance?.amount ?? '--'}
| </Flex> | ||
| <Flex gap={1}> | ||
| <Text fontWeight="semibold"> | ||
| Staked: {balanceStaked?.amount || '--'} |
There was a problem hiding this comment.
ok i ll fix it at stark-tech-space/create-cosmos-app,
|
|
||
| const getBalance = async () => { | ||
| const client = await getSigningStargateClient(); | ||
| const balance = await client?.getBalance(address as string, 'OSMO'); |
There was a problem hiding this comment.
OSMO, is this part of the API to use symbols?
There was a problem hiding this comment.
ideally we can use uosmo, but maybe it's the API. I'm curious for sure ;)
There was a problem hiding this comment.
https://cosmos.github.io/cosmjs/latest/stargate/classes/StargateClient.html#getBalanceStaked
getBalance function use denom not symbol
There was a problem hiding this comment.
yes, denom is uosmo, not OSMO right?
There was a problem hiding this comment.
| ...asset_list.assets.filter((item) => item.display != 'usdc'), | ||
| ].filter(({ type_asset }) => type_asset !== 'ics20'); | ||
|
|
||
| export const osmosisAssetsList: AssetList[] = [ |
There was a problem hiding this comment.
shouldn't we just import the assets? Why are we making a new one?
| }, | ||
| ]; | ||
| // console.log(asset_list, assets, osmosisAssetsList); | ||
| export const getOsmoAssetByDenom = (denom: CoinDenom): Asset => { |
There was a problem hiding this comment.
I think ideally, we don't rebuild new methods here, we should either
- use the chain-registry/utils and pass the word osmosis for chain_name, or use the chain-registry/client ChainRegistryClient class
AND/OR
- use https://github.com/osmosis-labs/osmojs/tree/main/packages/math which I think has a lot of these methods, also
There was a problem hiding this comment.
e, I tested it.
import { asset_list, assets } from '@chain-registry/osmosis';
export const osmosisAssets: Asset[] = [
...assets.assets,
...asset_list.assets.filter((item) => item.display != 'usdc'),
].filter(({ type_asset }) => type_asset !== 'ics20');
export const osmosisAssetsList: AssetList[] = [
{
assets: osmosisAssets,
chain_name: 'osmosis',
},
];
The previous developers had a reason to merge assets and asset_list. If you only use asset_list, some assets might not be found.
if not merge
import { asset_list, assets } from '@chain-registry/osmosis';
export const osmosisAssets: Asset[] = assets.filter(({ type_asset }) => type_asset !== 'ics20');
const osmosisAssetsList = [asset_list];
okay, I Fix it @pyramation |
3e288bd to
50c5a2a
Compare


Fix liquidity bug & add balance components