Skip to content

Commit

Permalink
fix: inj on live
Browse files Browse the repository at this point in the history
  • Loading branch information
nick134-bit committed Jul 24, 2024
1 parent 2c57dfa commit d233035
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const bondTokens: any = async (
message: handleMsg,
funds: [coin(amount, denom)],
})
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, [execMsg], await createGasFee(
injectiveSigningClient, address, [execMsg],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const claimRewards: any = async (
contractAddress: config.fee_distributor,
message: handleMsg,
funds: [] })
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, [execMsg], await createGasFee(
injectiveSigningClient, address, [execMsg],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const createNewEpoch: any = async (
contractAddress: config.fee_distributor,
message: handleMsg,
funds: [] })
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, [execMsg], await createGasFee(
injectiveSigningClient, address, [execMsg],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const unbondTokens: any = async (
contractAddress: config.whale_lair,
message: handleMsg,
funds: [] })
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, [execMsg], await createGasFee(
injectiveSigningClient, address, [execMsg],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const withdrawTokens: any = async (
contractAddress: config.whale_lair,
message: handleMsg,
funds: [] })
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, [execMsg], await createGasFee(
injectiveSigningClient, address, [execMsg],
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Flashloan/Vaults/hooks/executeVault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const executeVault = async ({
injectiveSigningClient,
senderAddress,
}: ExecuteAddLiquidityArgs): Promise<any> => {
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
senderAddress, executionMsgs, await createGasFee(
injectiveSigningClient, senderAddress, executionMsgs,
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Flashloan/Vaults/hooks/useTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const useTransaction = ({
return
}
try {
const isInjective = await signingClient.getChainId() === ChainId.injective
const isInjective = await signingClient?.getChainId() === ChainId.injective
const response = isInjective && injectiveSigningClient ? await injectiveSigningClient?.simulate(
senderAddress,
debouncedMsgs,
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Flashloan/hooks/executeFlashloan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const executeFlashloan = async ({
contractAddress,
message: msgs,
})
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
contractAddress, [execMsg], await createGasFee(
injectiveSigningClient, contractAddress, [execMsg],
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Flashloan/hooks/useTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const useTransaction = ({
return
}
try {
const isInjective = await signingClient.getChainId() === ChainId.injective
const isInjective = await signingClient?.getChainId() === ChainId.injective
const response = isInjective && injectiveSigningClient ? await injectiveSigningClient?.simulate(
senderAddress,
debouncedMsgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const useClosePosition = ({ poolId }: OpenPosition) => {
}
}

if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, msg, await createGasFee(
injectiveSigningClient, address, msg,
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Trade/Incentivize/hooks/useOpenFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const useOpenFlow = ({ poolId, token, startDate, endDate }: Props) => {

const { mutate: submit, ...tx } = useMutation({
mutationFn: async () => {
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, msgs, await createGasFee(
injectiveSigningClient, address, msgs,
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Trade/Liquidity/hooks/useClaim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const useClaim = ({ poolId }: Props) => {

const { mutate: submit, ...state } = useMutation({
mutationFn: async () => {
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, [msg], await createGasFee(
injectiveSigningClient, address, [msg],
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Trade/Liquidity/hooks/useClosePosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const useClosePosition = ({ poolId }: OpenPosition) => {
unbonding_duration: number
}) => {
const msgs = createClosePositionMessage(unbonding_duration)
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, msgs, await createGasFee(
injectiveSigningClient, address, msgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const useTransaction: any = ({
return
}
try {
const isInjective = await signingClient.getChainId() === ChainId.injective
const isInjective = await signingClient?.getChainId() === ChainId.injective

const response = isInjective && injectiveSigningClient ? await injectiveSigningClient?.simulate(
senderAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const useForceEpochAndTakingSnapshots = ({

const { mutate: submit, ...state } = useMutation({
mutationFn: async () => {
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, msgs, await createGasFee(
injectiveSigningClient, address, msgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const useWithdrawPosition = ({ poolId }) => {

const { mutate: submit, ...state } = useMutation({
mutationFn: async () => {
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
address, msgs, await createGasFee(
injectiveSigningClient, address, msgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const useWithdrawTransaction: any = ({
return
}
try {
const isInjective = await signingClient.getChainId() === ChainId.injective
const isInjective = await signingClient?.getChainId() === ChainId.injective
const response = isInjective && injectiveSigningClient ? await injectiveSigningClient?.simulate(
senderAddress,
debouncedMsgs,
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Trade/Swap/hooks/directTokenSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const directTokenSwap = async ({
message: msgs,
funds: [coin(tokenAmount, tokenA.denom)],
})
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
senderAddress, [execMsg], await createGasFee(
injectiveSigningClient, senderAddress, [execMsg],
Expand Down
2 changes: 1 addition & 1 deletion components/Pages/Trade/Swap/hooks/useTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const useTransaction = ({
return null
}
try {
const isInjective = await signingClient.getChainId() === ChainId.injective
const isInjective = await signingClient?.getChainId() === ChainId.injective
const sim = await createGasFee(
isInjective ? injectiveSigningClient : signingClient, senderAddress, debouncedMsgs,
)
Expand Down
2 changes: 1 addition & 1 deletion hooks/useSimulate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const useSimulate = ({
error: null,
buttonLabel: null,
})
const isInjective = await signingClient.getChainId() === ChainId.injective
const isInjective = await signingClient?.getChainId() === ChainId.injective
return isInjective && injectiveSigningClient ? injectiveSigningClient?.simulate(
address, msgs, null,
) : signingClient?.simulate(
Expand Down
2 changes: 1 addition & 1 deletion hooks/useTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const useTransaction = ({
return
}
try {
const isInjective = await signingClient.getChainId() === ChainId.injective
const isInjective = await signingClient?.getChainId() === ChainId.injective
const response = isInjective && injectiveSigningClient ? await injectiveSigningClient?.simulate(
senderAddress,
debouncedMsgs,
Expand Down
2 changes: 1 addition & 1 deletion services/liquidity/executeAddLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const executeAddLiquidity = async ({
senderAddress,
msgs,
}: ExecuteAddLiquidityArgs): Promise<any> => {
if (injectiveSigningClient && await signingClient.getChainId() === ChainId.injective) {
if (injectiveSigningClient && await signingClient?.getChainId() === ChainId.injective) {
const injectiveTxData = await injectiveSigningClient.sign(
senderAddress, msgs, await createGasFee(
injectiveSigningClient, senderAddress, msgs,
Expand Down

0 comments on commit d233035

Please sign in to comment.