Replace references to mango-transaction-log

This commit is contained in:
Riordan Panayides 2023-01-18 13:13:29 +00:00
parent 7107b91ad1
commit 4d5230cf05
6 changed files with 23 additions and 16 deletions

View File

@ -6,6 +6,7 @@ import { useTranslation } from 'next-i18next'
import Button, { LinkButton } from '../shared/Button' import Button, { LinkButton } from '../shared/Button'
import { bs58 } from '@project-serum/anchor/dist/cjs/utils/bytes' import { bs58 } from '@project-serum/anchor/dist/cjs/utils/bytes'
import { notify } from 'utils/notifications' import { notify } from 'utils/notifications'
import { MANGO_DATA_API_URL } from 'utils/constants'
const ImgWithLoader = (props: any) => { const ImgWithLoader = (props: any) => {
const [isLoading, setIsLoading] = useState(true) const [isLoading, setIsLoading] = useState(true)
@ -67,7 +68,7 @@ const EditNftProfilePic = ({ onClose }: { onClose: () => void }) => {
}), }),
} }
const response = await fetch( const response = await fetch(
'https://mango-transaction-log.herokuapp.com/v4/user-data/profile-details', `${MANGO_DATA_API_URL}/user-data/profile-details`,
requestOptions requestOptions
) )
if (response.status === 200) { if (response.status === 200) {
@ -113,7 +114,7 @@ const EditNftProfilePic = ({ onClose }: { onClose: () => void }) => {
}), }),
} }
const response = await fetch( const response = await fetch(
'https://mango-transaction-log.herokuapp.com/v4/user-data/profile-details', `${MANGO_DATA_API_URL}/user-data/profile-details`,
requestOptions requestOptions
) )
if (response.status === 200) { if (response.status === 200) {

View File

@ -14,6 +14,7 @@ import mangoStore from '@store/mangoStore'
import startCase from 'lodash/startCase' import startCase from 'lodash/startCase'
import { useTranslation } from 'next-i18next' import { useTranslation } from 'next-i18next'
import { ChangeEvent, useState } from 'react' import { ChangeEvent, useState } from 'react'
import { MANGO_DATA_API_URL } from 'utils/constants'
import { notify } from 'utils/notifications' import { notify } from 'utils/notifications'
import ProfileImage from './ProfileImage' import ProfileImage from './ProfileImage'
@ -42,7 +43,7 @@ const EditProfileForm = ({
try { try {
setLoadUniquenessCheck(true) setLoadUniquenessCheck(true)
const response = await fetch( 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() const uniquenessCheck = await response.json()
@ -103,7 +104,7 @@ const EditProfileForm = ({
}), }),
} }
const response = await fetch( const response = await fetch(
'https://mango-transaction-log.herokuapp.com/v4/user-data/profile-details', `${MANGO_DATA_API_URL}/user-data/profile-details`,
requestOptions requestOptions
) )
if (response.status === 200) { if (response.status === 200) {

View File

@ -3,6 +3,7 @@ import { XMarkIcon } from '@heroicons/react/20/solid'
import { useWallet } from '@solana/wallet-adapter-react' import { useWallet } from '@solana/wallet-adapter-react'
import mangoStore from '@store/mangoStore' import mangoStore from '@store/mangoStore'
import { useState } from 'react' import { useState } from 'react'
import { MANGO_DATA_API_URL } from 'utils/constants'
import { WalktourLogic } from 'walktour' import { WalktourLogic } from 'walktour'
const CustomTooltip = ({ const CustomTooltip = ({
@ -37,7 +38,7 @@ const CustomTooltip = ({
body: message, body: message,
} }
const response = await fetch( const response = await fetch(
'https://mango-transaction-log.herokuapp.com/v4/user-data/settings-unsigned', `${MANGO_DATA_API_URL}/user-data/settings-unsigned`,
requestOptions requestOptions
) )
if (response.status === 200) { if (response.status === 200) {

View File

@ -5,10 +5,11 @@ import { useQuery } from '@tanstack/react-query'
import useMangoGroup from 'hooks/useMangoGroup' import useMangoGroup from 'hooks/useMangoGroup'
import useSelectedMarket from 'hooks/useSelectedMarket' import useSelectedMarket from 'hooks/useSelectedMarket'
import { useMemo } from 'react' import { useMemo } from 'react'
import { MANGO_DATA_API_URL } from 'utils/constants'
const fetchFundingRate = async (groupPk: string | undefined) => { const fetchFundingRate = async (groupPk: string | undefined) => {
const res = await fetch( 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() return await res.json()
} }

View File

@ -33,6 +33,7 @@ import {
DEFAULT_MARKET_NAME, DEFAULT_MARKET_NAME,
INPUT_TOKEN_DEFAULT, INPUT_TOKEN_DEFAULT,
LAST_ACCOUNT_KEY, LAST_ACCOUNT_KEY,
MANGO_DATA_API_URL,
OUTPUT_TOKEN_DEFAULT, OUTPUT_TOKEN_DEFAULT,
RPC_PROVIDER_KEY, RPC_PROVIDER_KEY,
} from '../utils/constants' } from '../utils/constants'
@ -461,7 +462,7 @@ const mangoStore = create<MangoStore>()(
}) })
try { try {
const response = await fetch( 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 parsedResponse = await response.json()
const entries: any = Object.entries(parsedResponse).sort((a, b) => const entries: any = Object.entries(parsedResponse).sort((a, b) =>
@ -498,7 +499,7 @@ const mangoStore = create<MangoStore>()(
}) })
try { try {
const response = await fetch( 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') .subtract(range, 'day')
.format('YYYY-MM-DD')}` .format('YYYY-MM-DD')}`
) )
@ -541,7 +542,7 @@ const mangoStore = create<MangoStore>()(
try { try {
const response = await fetch( const response = await fetch(
`https://mango-transaction-log.herokuapp.com/v4/stats/activity-feed?mango-account=${mangoAccountPk}&offset=${offset}&limit=25${ `${MANGO_DATA_API_URL}/stats/activity-feed?mango-account=${mangoAccountPk}&offset=${offset}&limit=25${
params ? params : '' params ? params : ''
}` }`
) )
@ -817,7 +818,7 @@ const mangoStore = create<MangoStore>()(
}) })
try { try {
const response = await fetch( 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() const data = await response.json()
@ -840,7 +841,7 @@ const mangoStore = create<MangoStore>()(
setTimeout(async () => { setTimeout(async () => {
try { try {
const history = await fetch( 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 parsedHistory = await history.json()
const sortedHistory = const sortedHistory =
@ -876,7 +877,7 @@ const mangoStore = create<MangoStore>()(
}) })
try { try {
const response = await fetch( 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() const data = await response.json()
@ -945,7 +946,7 @@ const mangoStore = create<MangoStore>()(
}) })
try { try {
const response = await fetch( 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() const data = await response.json()
set((state) => { set((state) => {
@ -967,7 +968,7 @@ const mangoStore = create<MangoStore>()(
}) })
try { try {
const response = await fetch( 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() const data = await response.json()
set((state) => { set((state) => {
@ -1021,10 +1022,10 @@ const mangoStore = create<MangoStore>()(
try { try {
const [spotRes, perpRes] = await Promise.all([ const [spotRes, perpRes] = await Promise.all([
fetch( fetch(
`https://mango-transaction-log.herokuapp.com/v4/stats/openbook-trades?address=${mangoAccount?.publicKey.toString()}&address-type=mango-account` `${MANGO_DATA_API_URL}/stats/openbook-trades?address=${mangoAccount?.publicKey.toString()}&address-type=mango-account`
), ),
fetch( fetch(
`https://mango-transaction-log.herokuapp.com/v4/stats/perp-trade-history?mango-account=${mangoAccount?.publicKey.toString()}&limit=1000` `${MANGO_DATA_API_URL}/stats/perp-trade-history?mango-account=${mangoAccount?.publicKey.toString()}&limit=1000`
), ),
]) ])
const spotHistory = await spotRes.json() const spotHistory = await spotRes.json()

View File

@ -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_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 DEFAULT_MARKET_NAME = 'SOL/USDC'
export const MIN_SOL_BALANCE = 0.001 export const MIN_SOL_BALANCE = 0.001