The only public Mantle server was shut down in January 2023. This patch migrates
the app from Mantle to Hive.

Requires 1_tax_git.diff and 1_gql_git.diff applied before.

Requires 1_networks_git.diff applied (before or after).

diff --git a/src/constants.ts b/src/constants.ts
index 361a0e4..e159fd9 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -7,5 +7,2 @@
 
-/* terra:wasm */
-export const WASMQUERY = "WasmContractsContractAddressStore"
-
 /* terra:configs */
diff --git a/src/data/contract/alias.ts b/src/data/contract/alias.ts
index 8aff7d8..76815dc 100644
--- a/src/data/contract/alias.ts
+++ b/src/data/contract/alias.ts
@@ -1,6 +1,5 @@
-import { gqlserialize_quotjson, gqlkeyvalidate, gqlnamevalidate } from "./gql"
+import { gqlserialize_gqlnot, gqlkeyvalidate, gqlnamevalidate } from "./gql"
 import { gql } from "graphql-request"
-import { WASMQUERY } from "../../constants"
 
 interface Query extends Partial<ContractVariables> {
   name: string
@@ -10,12 +9,11 @@ const getDocument = ({ name, contract, msg }: Query): string =>
   !msg
     ? ``
     : `
-    ${gqlkeyvalidate(name)}: ${WASMQUERY}(
-      ContractAddress: ${JSON.stringify(contract)}
-      QueryMsg: ${gqlserialize_quotjson(msg)}
-    ) {
-      Height
-      Result
+    ${gqlkeyvalidate(name)}: wasm {
+      contractQuery(
+        contractAddress: ${JSON.stringify(contract)}
+        query: ${gqlserialize_gqlnot(msg)}
+      )
     }`
 
 export default (queries: Query[], name: string): string => gql`
diff --git a/src/data/contract/normalize.ts b/src/data/contract/normalize.ts
index b2f6b31..c6d563a 100644
--- a/src/data/contract/normalize.ts
+++ b/src/data/contract/normalize.ts
@@ -17,7 +17,7 @@ import { govStakerQuery } from "./contract"
 export const nativePricesQuery = selector({
   key: "nativePrices",
   get: ({ get }) =>
-    reduceNativePrice(get(exchangeRatesQuery).OracleDenomsExchangeRates.Result),
+    reduceNativePrice(get(exchangeRatesQuery).oracle.exchangeRates),
 })
 
 const nativePricesState = atom<Dictionary>({
@@ -73,8 +73,7 @@ const endPricesState = atom<Dictionary>({
 /* balance */
 export const nativeBalancesQuery = selector({
   key: "nativeBalances",
-  get: ({ get }) =>
-    reduceByDenom(get(bankBalanceQuery)?.BankBalancesAddress?.Result ?? []),
+  get: ({ get }) => reduceByDenom(get(bankBalanceQuery)?.bank?.balance ?? []),
 })
 
 const nativeBalancesState = atom<Dictionary>({
@@ -405,13 +404,13 @@ const reduceStakingReward = (
     {}
   )
 
-const reduceNativePrice = (coins: MantleCoin[]): Dictionary => ({
+const reduceNativePrice = (coins: HiveCoin[]): Dictionary => ({
   uusd: "1",
-  uluna: coins.find(({ Denom }) => Denom === "uusd")?.Amount ?? "0",
+  uluna: coins.find(({ denom }) => denom === "uusd")?.amount ?? "0",
 })
 
-const reduceByDenom = (coins: MantleCoin[]) =>
+const reduceByDenom = (coins: HiveCoin[]) =>
   coins.reduce<Dictionary>(
-    (acc, { Amount, Denom }) => ({ ...acc, [Denom]: Amount }),
+    (acc, { amount, denom }) => ({ ...acc, [denom]: amount }),
     {}
   )
diff --git a/src/data/external/anchor.ts b/src/data/external/anchor.ts
index 4a4a4c9..302845e 100644
--- a/src/data/external/anchor.ts
+++ b/src/data/external/anchor.ts
@@ -1,7 +1,7 @@
 import { gql, request } from "graphql-request"
 import { selector } from "recoil"
 import { getContractQueryQuery } from "../utils/query"
-import { mantleURLQuery, networkNameState } from "../network"
+import { hiveURLQuery, networkNameState } from "../network"
 import { getPairPricesQuery, getTokenBalancesQuery } from "./terraswap"
 
 interface Protocol {
@@ -99,19 +99,35 @@ interface EpochState {
 
 const LAST_SYNCED_HEIGHT = gql`
   query {
-    LastSyncedHeight
+    tendermint {
+      blockInfo {
+        block {
+          header {
+            height
+          }
+        }
+      }
+    }
   }
 `
 
 const lastSyncedHeightQuery = selector({
   key: "lastSyncedHeight",
   get: async ({ get }) => {
-    const url = get(mantleURLQuery)
-    const { LastSyncedHeight } = await request<{ LastSyncedHeight: number }>(
-      url + "?height",
-      LAST_SYNCED_HEIGHT
-    )
-
+    const url = get(hiveURLQuery)
+    const res = await request<{
+      tendermint: {
+        blockInfo: {
+          block: {
+            header: {
+              height: string
+            }
+          }
+        }
+      }
+    }>(url + "?height", LAST_SYNCED_HEIGHT)
+    const heightstr: string = res.tendermint.blockInfo.block.header.height
+    const LastSyncedHeight: number = Number.parseInt(heightstr)
     return LastSyncedHeight
   },
 })
diff --git a/src/data/native/gqldocs.ts b/src/data/native/gqldocs.ts
index cb86c5d..9602e04 100644
--- a/src/data/native/gqldocs.ts
+++ b/src/data/native/gqldocs.ts
@@ -1,11 +1,11 @@
 import { gql } from "graphql-request"
 
 export const BANK_BALANCES_ADDRESS = gql`
-  query BankBalancesAddress($address: String) {
-    BankBalancesAddress(Address: $address) {
-      Result {
-        Amount
-        Denom
+  query BankBalancesAddress($address: String!) {
+    bank {
+      balance(address: $address) {
+        amount
+        denom
       }
     }
   }
@@ -13,11 +13,10 @@ export const BANK_BALANCES_ADDRESS = gql`
 
 export const ORACLE_DENOMS_EXCHANGE_RATES = gql`
   query OracleDenomsExchangeRates {
-    OracleDenomsExchangeRates {
-      Height
-      Result {
-        Amount
-        Denom
+    oracle {
+      exchangeRates {
+        amount
+        denom
       }
     }
   }
@@ -25,52 +24,57 @@ export const ORACLE_DENOMS_EXCHANGE_RATES = gql`
 
 export const TAX = gql`
   query tax {
-    TreasuryTaxRate {
-      Result
+    treasury {
+      taxRate(denom: "uusd")
     }
 
-    TreasuryTaxCapDenom(Denom: "uusd") {
-      Result
+    treasury {
+      taxCap(denom: "uusd") {
+        amount
+        denom
+      }
     }
   }
 `
 
 export const WASM = gql`
-  query WasmContractsContractAddressStore($contract: String, $msg: String) {
-    WasmContractsContractAddressStore(
-      ContractAddress: $contract
-      QueryMsg: $msg
-    ) {
-      Height
-      Result
+  query WasmContractsContractAddressStore($contract: String!, $msg: JSON!) {
+    wasm {
+      contractQuery(contractAddress: $contract, query: $msg)
     }
   }
 `
 
 export const TX_INFOS = gql`
-  query TxInfos($hash: String) {
-    TxInfos(TxHash: $hash) {
-      Height
-      TxHash
-      Success
-      RawLog
+  query TxInfos($hash: String!) {
+    tx {
+      txInfo(txHash: $hash) {
+        height
+        txhash
+        code
+        raw_log
 
-      Tx {
-        Fee {
-          Amount {
-            Amount
-            Denom
+        tx {
+          auth_info {
+            fee {
+              amount {
+                amount
+                denom
+              }
+            }
+          }
+          body {
+            memo
           }
         }
-        Memo
-      }
 
-      Logs {
-        Events {
-          Type
-          Attributes {
-            Key
-            Value
+        logs {
+          events {
+            type
+            attributes {
+              key
+              value
+            }
           }
         }
       }
diff --git a/src/data/native/tax.ts b/src/data/native/tax.ts
index 951cd72..cc6fd43 100644
--- a/src/data/native/tax.ts
+++ b/src/data/native/tax.ts
@@ -1,13 +1,13 @@
 import { selector } from "recoil"
 import { request } from "graphql-request"
-import { mantleURLQuery } from "../network"
+import { hiveURLQuery } from "../network"
 import { TAX } from "./gqldocs"
 
 export const taxQuery = selector({
   key: "tax",
   get: async ({ get }) => {
     // request once
-    const url = get(mantleURLQuery)
+    const url = get(hiveURLQuery)
     return await request<TaxData>(url + "?tax", TAX)
   },
 })
diff --git a/src/data/native/tx.ts b/src/data/native/tx.ts
index 49081fd..e81da31 100644
--- a/src/data/native/tx.ts
+++ b/src/data/native/tx.ts
@@ -1,16 +1,16 @@
 import { request } from "graphql-request"
 import { selector } from "recoil"
-import { mantleURLQuery } from "../network"
+import { hiveURLQuery } from "../network"
 import { TX_INFOS } from "./gqldocs"
 
 export const getTxInfosQuery = selector({
   key: "getTxInfos",
   get: ({ get }) => {
     // request by hash
-    const url = get(mantleURLQuery)
+    const url = get(hiveURLQuery)
     return async (hash: string) => {
       const data = await request<TxInfos>(url + "?TxInfos", TX_INFOS, { hash })
-      return data.TxInfos[0]
+      return data.tx.txInfo
     }
   },
 })
diff --git a/src/data/network.ts b/src/data/network.ts
index f945763..4dfc90a 100644
--- a/src/data/network.ts
+++ b/src/data/network.ts
@@ -14,10 +14,10 @@ export const networkQuery = selector({
   },
 })
 
-export const mantleURLQuery = selector({
-  key: "mantleURL",
+export const hiveURLQuery = selector({
+  key: "hiveURL",
   get: ({ get }) => {
-    const { mantle } = get(networkQuery)
-    return mantle
+    const { hive } = get(networkQuery)
+    return hive
   },
 })
diff --git a/src/data/utils/parse.ts b/src/data/utils/parse.ts
index 1291725..54d5543 100644
--- a/src/data/utils/parse.ts
+++ b/src/data/utils/parse.ts
@@ -1,5 +1,7 @@
-export const parseResult = <Parsed>(params: { Result: string } | null) =>
-  params ? (JSON.parse(params.Result) as Parsed) : undefined
+export const parseResult = <Parsed>(params: { contractQuery: object } | null) =>
+  params
+    ? (JSON.parse(JSON.stringify(params.contractQuery)) as Parsed)
+    : undefined
 
 export const parseResults = <Parsed>(object: Dictionary<ContractData | null>) =>
   Object.entries(object).reduce<Dictionary<Parsed>>((acc, [token, data]) => {
diff --git a/src/data/utils/queries.ts b/src/data/utils/queries.ts
index 97238be..eed139e 100644
--- a/src/data/utils/queries.ts
+++ b/src/data/utils/queries.ts
@@ -4,7 +4,7 @@ import { ClientError, RequestDocument } from "graphql-request/dist/types"
 import alias from "../contract/alias"
 import { protocolQuery } from "../contract/protocol"
 import { locationKeyState } from "../app"
-import { mantleURLQuery } from "../network"
+import { hiveURLQuery } from "../network"
 import { parseResults } from "./parse"
 
 export const LUNA: ListedItem = {
@@ -61,7 +61,7 @@ export const getContractQueriesQuery = selector({
   key: "getContractQueries",
   get: ({ get }) => {
     get(locationKeyState)
-    const url = get(mantleURLQuery)
+    const url = get(hiveURLQuery)
 
     return async <Parsed>(document: RequestDocument, name: string) => {
       try {
diff --git a/src/data/utils/query.ts b/src/data/utils/query.ts
index 91d8158..40b4868 100644
--- a/src/data/utils/query.ts
+++ b/src/data/utils/query.ts
@@ -1,9 +1,8 @@
 import { selector } from "recoil"
 import { request } from "graphql-request"
 import { RequestDocument, Variables } from "graphql-request/dist/types"
-import { WASMQUERY } from "../../constants"
 import { locationKeyState } from "../app"
-import { mantleURLQuery } from "../network"
+import { hiveURLQuery } from "../network"
 import { parseResult } from "./parse"
 import { WASM } from "../native/gqldocs"
 
@@ -12,7 +11,7 @@ export const getNativeQueryQuery = selector({
   key: "getNativeQuery",
   get: ({ get }) => {
     get(locationKeyState)
-    const url = get(mantleURLQuery)
+    const url = get(hiveURLQuery)
 
     return async <Parsed>(
       params: { document: RequestDocument; variables?: Variables },
@@ -29,7 +28,7 @@ export const getContractQueryQuery = selector({
   key: "getContractQuery",
   get: ({ get }) => {
     get(locationKeyState)
-    const url = get(mantleURLQuery)
+    const url = get(hiveURLQuery)
 
     return async <Parsed>(variables: ContractVariables, name: string) => {
       const document = getDocument(variables)
@@ -40,12 +39,12 @@ export const getContractQueryQuery = selector({
         document
       )
 
-      return parseResult<Parsed>(result[WASMQUERY])
+      return parseResult<Parsed>(result["wasm"])
     }
   },
 })
 
 /* helpers */
 export const getDocument = ({ contract, msg }: ContractVariables) => {
-  return { contract, msg: JSON.stringify(msg) }
+  return { contract, msg }
 }
diff --git a/src/forms/modules/Result.tsx b/src/forms/modules/Result.tsx
index 375b551..97cc3f2 100644
--- a/src/forms/modules/Result.tsx
+++ b/src/forms/modules/Result.tsx
@@ -44,7 +44,7 @@ const Result = ({ response, error, parseTx, onFailure, ...props }: Props) => {
 
   /* status */
   const status =
-    !success || !hash || tx.error || (txInfo && !txInfo?.Success)
+    !success || !hash || tx.error || (txInfo && !(txInfo?.code === 0))
       ? STATUS.FAILURE
       : tx.isLoading || !txInfo
       ? STATUS.LOADING
@@ -67,7 +67,7 @@ const Result = ({ response, error, parseTx, onFailure, ...props }: Props) => {
 
   /* verbose */
   const verbose = txInfo
-    ? JSON.stringify(concatFromContract(txInfo.Logs), null, 2)
+    ? JSON.stringify(concatFromContract(txInfo.logs), null, 2)
     : undefined
 
   useEffect(() => {
@@ -80,7 +80,7 @@ const Result = ({ response, error, parseTx, onFailure, ...props }: Props) => {
 
   /* render */
   const message =
-    txInfo?.RawLog ||
+    txInfo?.raw_log ||
     raw_log ||
     error?.message ||
     (error instanceof UserDenied && MESSAGE.Result.DENIED)
diff --git a/src/forms/modules/TxInfo.tsx b/src/forms/modules/TxInfo.tsx
index 5074166..e643ce8 100644
--- a/src/forms/modules/TxInfo.tsx
+++ b/src/forms/modules/TxInfo.tsx
@@ -9,15 +9,15 @@ interface Props {
 }
 
 const TxInfo = ({ txInfo, parser }: Props) => {
-  const { TxHash: hash, Tx } = txInfo
-  const logs = txInfo?.Logs
-  const [fee] = Tx.Fee.Amount
+  const { txhash: hash, tx } = txInfo
+  const logs = txInfo?.logs
+  const [fee] = tx.auth_info.fee.amount
 
   const receipt = parser?.(logs, txInfo) ?? []
   const footer = [
     {
       title: "Tx Fee",
-      content: `+ ${formatAsset(fee.Amount, fee.Denom)}`,
+      content: `+ ${formatAsset(fee.amount, fee.denom)}`,
     },
     {
       title: "Tx Hash",
diff --git a/src/forms/receipts/receiptHelpers.ts b/src/forms/receipts/receiptHelpers.ts
index c1e0581..03b2281 100644
--- a/src/forms/receipts/receiptHelpers.ts
+++ b/src/forms/receipts/receiptHelpers.ts
@@ -2,26 +2,26 @@
 export const findValueFromLogs =
   (logs: TxLog[]) =>
   (key: string, index = 0) => {
-    const attribute = logs[index]?.Events.find(
-      (e) => e.Type === "from_contract"
-    )?.Attributes
+    const attribute = logs[index]?.events.find(
+      (e) => e.type === "from_contract"
+    )?.attributes
 
-    return attribute?.find((attr) => attr.Key === key)?.Value ?? ""
+    return attribute?.find((attr) => attr.key === key)?.value ?? ""
   }
 
 export const concatFromContract = (logs: TxLog[]) => {
   return logs
-    .map(({ Events }) => {
-      const attributes = Events.find(
-        ({ Type }) => Type === "from_contract"
-      )?.Attributes
+    .map(({ events }) => {
+      const attributes = events.find(
+        ({ type }) => type === "from_contract"
+      )?.attributes
 
-      return attributes?.reduce<FromContract[]>((acc, { Key, Value }) => {
-        const sep = Key === "contract_address"
+      return attributes?.reduce<FromContract[]>((acc, { key, value }) => {
+        const sep = key === "contract_address"
         const last = acc[acc.length - 1]
         return sep
-          ? [...acc, { [Key]: Value }]
-          : [...acc.slice(0, acc.length - 1), { ...last, [Key]: Value }]
+          ? [...acc, { [key]: value }]
+          : [...acc.slice(0, acc.length - 1), { ...last, [key]: value }]
       }, [])
     })
     .reduce<FromContract[]>((acc = [], cur = []) => [...acc, ...cur], [])
@@ -38,15 +38,15 @@ export const findPathFromContract = (logs: TxLog[]) => {
 
 export const parseEvents = (events: TxEvent[]) =>
   events.reduce<Dictionary<Dictionary>>(
-    (acc, { Type, Attributes }) => ({
+    (acc, { type, attributes }) => ({
       ...acc,
-      [Type]: parseAttributes(Attributes),
+      [type]: parseAttributes(attributes),
     }),
     {}
   )
 
 const parseAttributes = (attributes: Attribute[]) =>
-  attributes.reduce((acc, { Key, Value }) => ({ ...acc, [Key]: Value }), {})
+  attributes.reduce((acc, { key, value }) => ({ ...acc, [key]: value }), {})
 
 export const splitTokenText = (string = "") => {
   const [, amount, token] = string.split(/(\d+)(\w+)/)
diff --git a/src/forms/receipts/useSendReceipt.ts b/src/forms/receipts/useSendReceipt.ts
index 682ce2e..f069da9 100644
--- a/src/forms/receipts/useSendReceipt.ts
+++ b/src/forms/receipts/useSendReceipt.ts
@@ -8,11 +8,11 @@ import {
 } from "./receiptHelpers"
 
 export default () =>
-  (logs: TxLog[], { Tx }: TxInfo) => {
+  (logs: TxLog[], { tx }: TxInfo) => {
     const { shuttle } = useNetwork()
     const { getSymbol } = useProtocol()
     const val = findValueFromLogs(logs)
-    const { transfer } = parseEvents(logs[0]["Events"])
+    const { transfer } = parseEvents(logs[0]["events"])
     const uusd = splitTokenText(transfer?.amount)
 
     const address = val("to")
@@ -21,7 +21,7 @@ export default () =>
     const symbol = getSymbol(token)
 
     const recipient = transfer?.recipient ?? address
-    const $memo = Tx.Memo
+    const $memo = tx.body.memo
     const to = Object.values(shuttle).includes(recipient) ? $memo : recipient
     const memo = Object.values(shuttle).includes(recipient) ? "" : $memo
 
diff --git a/src/hooks/useTax.ts b/src/hooks/useTax.ts
index 306039a..b5b1d44 100644
--- a/src/hooks/useTax.ts
+++ b/src/hooks/useTax.ts
@@ -9,8 +9,8 @@ export default () => {
   const data = getLoadableContents(taxLoadable)
   const fee = useFee()
 
-  const rate = data?.TreasuryTaxRate.Result
-  const cap = data?.TreasuryTaxCapDenom.Result
+  const rate = data?.treasury.taxRate
+  const cap = data?.treasury.taxCap.amount
 
   const calcTax = (amount = "0") =>
     rate && cap
diff --git a/src/pages/Tools/Receipt.tsx b/src/pages/Tools/Receipt.tsx
index fc39143..83defb2 100644
--- a/src/pages/Tools/Receipt.tsx
+++ b/src/pages/Tools/Receipt.tsx
@@ -112,7 +112,7 @@ const Receipt = () => {
           <Gutter>
             <Card title="From Contract">
               <pre>
-                {JSON.stringify(concatFromContract(txInfo.Logs), null, 2)}
+                {JSON.stringify(concatFromContract(txInfo.logs), null, 2)}
               </pre>
             </Card>
           </Gutter>
diff --git a/src/types/contract.d.ts b/src/types/contract.d.ts
index b7f88a0..a9643c8 100644
--- a/src/types/contract.d.ts
+++ b/src/types/contract.d.ts
@@ -4,7 +4,7 @@ interface ContractVariables {
   msg: object
 }
 
-type ContractData = { Height: string; Result: string }
+type ContractData = { contractQuery: object }
 interface WasmResponse {
-  WasmContractsContractAddressStore: ContractData | null
+  wasm: ContractData | null
 }
diff --git a/src/types/data.d.ts b/src/types/data.d.ts
index b72d955..54e609a 100644
--- a/src/types/data.d.ts
+++ b/src/types/data.d.ts
@@ -104,16 +104,16 @@ interface Order {
 
 /* Native Info */
 interface OracleDenomsExchangeRates {
-  OracleDenomsExchangeRates: { Result: MantleCoin[] }
+  oracle: { exchangeRates: HiveCoin[] }
 }
 
 interface BankBalanceAddress {
-  BankBalancesAddress?: { Result: MantleCoin[] }
+  bank?: { balance: HiveCoin[] }
 }
 
-interface MantleCoin {
-  Amount: string
-  Denom: string
+interface HiveCoin {
+  amount: string
+  denom: string
 }
 
 /* CDP */
diff --git a/src/types/tx.d.ts b/src/types/tx.d.ts
index c17d26e..fb0fc9a 100644
--- a/src/types/tx.d.ts
+++ b/src/types/tx.d.ts
@@ -1,47 +1,54 @@
 interface TxInfos {
-  TxInfos: TxInfo[]
+  tx: {
+    txInfo: TxInfo
+  }
 }
 
 interface TxInfo {
-  Success: boolean
-  RawLog: string
-
-  TxHash: string
-
-  Tx: {
-    Fee: { Amount: FeeAmount[] }
-    Memo: string
+  code: int
+  raw_log: string
+
+  txhash: string
+
+  tx: {
+    auth_info: {
+      fee: { amount: FeeAmount[] }
+    }
+    body: {
+      memo: string
+    }
   }
 
-  Logs: TxLog[]
+  logs: TxLog[]
 }
 
 interface FeeAmount {
-  Amount: string
-  Denom: string
+  amount: string
+  denom: string
 }
 
 interface TxLog {
-  Events: TxEvent[]
+  events: TxEvent[]
 }
 
 interface TxEvent {
-  Attributes: Attribute[]
-  Type: string
+  attributes: Attribute[]
+  type: string
 }
 
 interface Attribute {
-  Key: string
-  Value: string
+  key: string
+  value: string
 }
 
 /* Tax */
 interface TaxData {
-  TreasuryTaxCapDenom: {
-    Result: string
-  }
-  TreasuryTaxRate: {
-    Result: string
+  treasury: {
+    taxCap: {
+      amount: string
+      denom: string
+    }
+    taxRate: string
   }
 }
 
