Merge pull request #70 from blockworks-foundation/pan/change-transaction-log-url
Replace references to mango-transaction-log
This commit is contained in:
commit
fdecaa9240
|
@ -6,6 +6,7 @@ import { useTranslation } from 'next-i18next'
|
|||
import Button, { LinkButton } from '../shared/Button'
|
||||
import { bs58 } from '@project-serum/anchor/dist/cjs/utils/bytes'
|
||||
import { notify } from 'utils/notifications'
|
||||
import { MANGO_DATA_API_URL } from 'utils/constants'
|
||||
|
||||
const ImgWithLoader = (props: any) => {
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
|
@ -67,7 +68,7 @@ const EditNftProfilePic = ({ onClose }: { onClose: () => void }) => {
|
|||
}),
|
||||
}
|
||||
const response = await fetch(
|
||||
'https://mango-transaction-log.herokuapp.com/v4/user-data/profile-details',
|
||||
`${MANGO_DATA_API_URL}/user-data/profile-details`,
|
||||
requestOptions
|
||||
)
|
||||
if (response.status === 200) {
|
||||
|
@ -113,7 +114,7 @@ const EditNftProfilePic = ({ onClose }: { onClose: () => void }) => {
|
|||
}),
|
||||
}
|
||||
const response = await fetch(
|
||||
'https://mango-transaction-log.herokuapp.com/v4/user-data/profile-details',
|
||||
`${MANGO_DATA_API_URL}/user-data/profile-details`,
|
||||
requestOptions
|
||||
)
|
||||
if (response.status === 200) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import mangoStore from '@store/mangoStore'
|
|||
import startCase from 'lodash/startCase'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { ChangeEvent, useState } from 'react'
|
||||
import { MANGO_DATA_API_URL } from 'utils/constants'
|
||||
import { notify } from 'utils/notifications'
|
||||
import ProfileImage from './ProfileImage'
|
||||
|
||||
|
@ -42,7 +43,7 @@ const EditProfileForm = ({
|
|||
try {
|
||||
setLoadUniquenessCheck(true)
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/user-data/check-profile-name-unique?profile-name=${name}`
|
||||
`${MANGO_DATA_API_URL}/user-data/check-profile-name-unique?profile-name=${name}`
|
||||
)
|
||||
const uniquenessCheck = await response.json()
|
||||
|
||||
|
@ -103,7 +104,7 @@ const EditProfileForm = ({
|
|||
}),
|
||||
}
|
||||
const response = await fetch(
|
||||
'https://mango-transaction-log.herokuapp.com/v4/user-data/profile-details',
|
||||
`${MANGO_DATA_API_URL}/user-data/profile-details`,
|
||||
requestOptions
|
||||
)
|
||||
if (response.status === 200) {
|
||||
|
|
|
@ -3,6 +3,7 @@ import { XMarkIcon } from '@heroicons/react/20/solid'
|
|||
import { useWallet } from '@solana/wallet-adapter-react'
|
||||
import mangoStore from '@store/mangoStore'
|
||||
import { useState } from 'react'
|
||||
import { MANGO_DATA_API_URL } from 'utils/constants'
|
||||
import { WalktourLogic } from 'walktour'
|
||||
|
||||
const CustomTooltip = ({
|
||||
|
@ -37,7 +38,7 @@ const CustomTooltip = ({
|
|||
body: message,
|
||||
}
|
||||
const response = await fetch(
|
||||
'https://mango-transaction-log.herokuapp.com/v4/user-data/settings-unsigned',
|
||||
`${MANGO_DATA_API_URL}/user-data/settings-unsigned`,
|
||||
requestOptions
|
||||
)
|
||||
if (response.status === 200) {
|
||||
|
|
|
@ -5,10 +5,11 @@ import { useQuery } from '@tanstack/react-query'
|
|||
import useMangoGroup from 'hooks/useMangoGroup'
|
||||
import useSelectedMarket from 'hooks/useSelectedMarket'
|
||||
import { useMemo } from 'react'
|
||||
import { MANGO_DATA_API_URL } from 'utils/constants'
|
||||
|
||||
const fetchFundingRate = async (groupPk: string | undefined) => {
|
||||
const res = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/one-hour-funding-rate?mango-group=${groupPk}`
|
||||
`${MANGO_DATA_API_URL}/one-hour-funding-rate?mango-group=${groupPk}`
|
||||
)
|
||||
return await res.json()
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import {
|
|||
DEFAULT_MARKET_NAME,
|
||||
INPUT_TOKEN_DEFAULT,
|
||||
LAST_ACCOUNT_KEY,
|
||||
MANGO_DATA_API_URL,
|
||||
OUTPUT_TOKEN_DEFAULT,
|
||||
PAGINATION_PAGE_LENGTH,
|
||||
RPC_PROVIDER_KEY,
|
||||
|
@ -464,7 +465,7 @@ const mangoStore = create<MangoStore>()(
|
|||
})
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/stats/interest-account-total?mango-account=${mangoAccountPk}`
|
||||
`${MANGO_DATA_API_URL}/stats/interest-account-total?mango-account=${mangoAccountPk}`
|
||||
)
|
||||
const parsedResponse = await response.json()
|
||||
const entries: any = Object.entries(parsedResponse).sort((a, b) =>
|
||||
|
@ -501,7 +502,7 @@ const mangoStore = create<MangoStore>()(
|
|||
})
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/stats/performance_account?mango-account=${mangoAccountPk}&start-date=${dayjs()
|
||||
`${MANGO_DATA_API_URL}/stats/performance_account?mango-account=${mangoAccountPk}&start-date=${dayjs()
|
||||
.subtract(range, 'day')
|
||||
.format('YYYY-MM-DD')}`
|
||||
)
|
||||
|
@ -545,7 +546,7 @@ const mangoStore = create<MangoStore>()(
|
|||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/stats/activity-feed?mango-account=${mangoAccountPk}&offset=${offset}&limit=${PAGINATION_PAGE_LENGTH}${
|
||||
`${MANGO_DATA_API_URL}/stats/activity-feed?mango-account=${mangoAccountPk}&offset=${offset}&limit=${PAGINATION_PAGE_LENGTH}${
|
||||
params ? params : ''
|
||||
}`
|
||||
)
|
||||
|
@ -821,7 +822,7 @@ const mangoStore = create<MangoStore>()(
|
|||
})
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/perp-historical-stats?mango-group=${group?.publicKey.toString()}`
|
||||
`${MANGO_DATA_API_URL}/perp-historical-stats?mango-group=${group?.publicKey.toString()}`
|
||||
)
|
||||
const data = await response.json()
|
||||
|
||||
|
@ -844,7 +845,7 @@ const mangoStore = create<MangoStore>()(
|
|||
setTimeout(async () => {
|
||||
try {
|
||||
const history = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/stats/swap-history?mango-account=${mangoAccountPk}`
|
||||
`${MANGO_DATA_API_URL}/stats/swap-history?mango-account=${mangoAccountPk}`
|
||||
)
|
||||
const parsedHistory = await history.json()
|
||||
const sortedHistory =
|
||||
|
@ -880,7 +881,7 @@ const mangoStore = create<MangoStore>()(
|
|||
})
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/token-historical-stats?mango-group=${group?.publicKey.toString()}`
|
||||
`${MANGO_DATA_API_URL}/token-historical-stats?mango-group=${group?.publicKey.toString()}`
|
||||
)
|
||||
const data = await response.json()
|
||||
|
||||
|
@ -949,7 +950,7 @@ const mangoStore = create<MangoStore>()(
|
|||
})
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/user-data/profile-details?wallet-pk=${walletPk}`
|
||||
`${MANGO_DATA_API_URL}/user-data/profile-details?wallet-pk=${walletPk}`
|
||||
)
|
||||
const data = await response.json()
|
||||
set((state) => {
|
||||
|
@ -971,7 +972,7 @@ const mangoStore = create<MangoStore>()(
|
|||
})
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/user-data/settings-unsigned?wallet-pk=${walletPk}`
|
||||
`${MANGO_DATA_API_URL}/user-data/settings-unsigned?wallet-pk=${walletPk}`
|
||||
)
|
||||
const data = await response.json()
|
||||
set((state) => {
|
||||
|
@ -1027,7 +1028,7 @@ const mangoStore = create<MangoStore>()(
|
|||
mangoStore.getState().mangoAccount.tradeHistory.data
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://mango-transaction-log.herokuapp.com/v4/stats/trade-history?mango-account=${mangoAccountPk}&limit=${PAGINATION_PAGE_LENGTH}&offset=${offset}`
|
||||
`${MANGO_DATA_API_URL}/stats/trade-history?mango-account=${mangoAccountPk}&limit=${PAGINATION_PAGE_LENGTH}&offset=${offset}`
|
||||
)
|
||||
const parsedHistory = await response.json()
|
||||
const newHistory = parsedHistory.map((h: any) => h.activity_details)
|
||||
|
|
|
@ -60,6 +60,8 @@ export const CHART_DATA_FEED = `https://dry-ravine-67635.herokuapp.com/tv`
|
|||
|
||||
export const MANGO_ROUTER_API_URL = 'https://api.mngo.cloud/router/v1'
|
||||
|
||||
export const MANGO_DATA_API_URL = 'https://api.mngo.cloud/data/v4'
|
||||
|
||||
export const DEFAULT_MARKET_NAME = 'SOL/USDC'
|
||||
|
||||
export const MIN_SOL_BALANCE = 0.001
|
||||
|
|
Loading…
Reference in New Issue