Skip to content

Commit

Permalink
fix: get okx direct signer (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick134-bit authored Mar 4, 2024
1 parent 1592795 commit 2d2577e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hooks/useClients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const useClients = (walletChainName: string) => {
isWalletConnected,
setDefaultSignOptions,
wallet,
getOfflineSignerDirect } = useChain(walletChainName)
getOfflineSignerDirect, getOfflineSigner } = useChain(walletChainName)
if (isWalletConnected && wallet?.name !== 'station-extension') {
try {
setDefaultSignOptions({
Expand All @@ -36,7 +36,12 @@ export const useClients = (walletChainName: string) => {
queryKey: ['injectiveSigningClient'],
queryFn: async () => {
try {
const offlineSigner: any = await getOfflineSignerDirect()
let offlineSigner
if (wallet.name.includes('okx')) {
offlineSigner = await getOfflineSigner()
} else {
offlineSigner = await getOfflineSignerDirect()
}
const client = await InjectiveStargate.InjectiveSigningStargateClient.connectWithSigner('https://sentry.tm.injective.network:443',
offlineSigner)
client.registry.register('/cosmwasm.wasm.v1.MsgExecuteContract', MsgExecuteContract)
Expand Down

0 comments on commit 2d2577e

Please sign in to comment.