-
Notifications
You must be signed in to change notification settings - Fork 130
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
don't call experimentalSuggestChain() if it's natively supported #475
Changes from 1 commit
c07e004
9b33624
e69a08b
33d04ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ import { | |
import { BroadcastMode, Keplr } from '@keplr-wallet/types'; | ||
import Long from 'long'; | ||
|
||
import { keplrExtensionInfo } from './registry'; | ||
|
||
export class KeplrClient implements WalletClient { | ||
readonly client: Keplr; | ||
private _defaultSignOptions: SignOptions = { | ||
|
@@ -121,6 +123,20 @@ export class KeplrClient implements WalletClient { | |
} | ||
|
||
async addChain(chainInfo: ChainRecord) { | ||
// TODO later allow walletInfo getter to be available here | ||
// make this more generic | ||
if ( | ||
keplrExtensionInfo.supportedChains && | ||
keplrExtensionInfo.supportedChains.length | ||
) { | ||
if (keplrExtensionInfo.supportedChains.includes(chainInfo.name)) { | ||
console.warn( | ||
`${chainInfo.name} is already added. No need to call experimentalSuggestChain()` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this after verifying that it works correctly @theothersideofgod |
||
); | ||
return; | ||
} | ||
} | ||
|
||
const suggestChain = chainRegistryChainToKeplr( | ||
chainInfo.chain, | ||
chainInfo.assetList ? [chainInfo.assetList] : [] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,34 @@ export const keplrExtensionInfo: Wallet = { | |
source: 'Request rejected', | ||
}, | ||
connectEventNamesOnWindow: ['keplr_keystorechange'], | ||
supportedChains: [ | ||
'agoric', | ||
'akash', | ||
'axelar', | ||
'bostrom', | ||
'certik', | ||
'cosmoshub', | ||
'cryptoorgchain', | ||
'emoney', | ||
'evmos', | ||
'gravitybridge', | ||
'irisnet', | ||
'ixo', | ||
'juno', | ||
'kava', | ||
'osmosis', | ||
'persistence', | ||
'regen', | ||
'secretnetwork', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add any one of these chains to test if it still works, then we've succeeded — using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test
both should work, and provide an address at least, with no errors from cosmos-kit |
||
'sentinel', | ||
'sifchain', | ||
'sommelier', | ||
'stargaze', | ||
'starname', | ||
'stride', | ||
'tgrade', | ||
'umee', | ||
], | ||
downloads: [ | ||
{ | ||
device: 'desktop', | ||
|
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.
@theothersideofgod make sure
chainInfo.name
ischain_name