Skip to content

Commit

Permalink
Remove Neutron and Sei, add Terra Classic
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Picco committed Mar 15, 2024
1 parent c9396d1 commit 6b1d6b8
Show file tree
Hide file tree
Showing 13 changed files with 351 additions and 619 deletions.
3 changes: 1 addition & 2 deletions frontend/claim_sdk/testWallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ export async function loadTestWallets(): Promise<
result['sui'] = [TestSuiWallet.fromKeyfile(suiPrivateKeyPath)]
result['aptos'] = [TestAptosWallet.fromKeyfile(aptosPrivateKeyPath)]
result['cosmwasm'] = [
await TestCosmWasmWallet.fromKeyFile(cosmosPrivateKeyPath, 'sei'),
await TestCosmWasmWallet.fromKeyFile(cosmosPrivateKeyPath, 'osmo'),
await TestCosmWasmWallet.fromKeyFile(cosmosPrivateKeyPath, 'neutron'),
await TestCosmWasmWallet.fromKeyFile(cosmosPrivateKeyPath, 'terra'),
]
result['injective'] = [TestEvmWallet.fromKeyfile(cosmosPrivateKeyPath, true)]

Expand Down
3 changes: 1 addition & 2 deletions frontend/components/Ecosystem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export enum Ecosystem {
SUI = 'Sui',
INJECTIVE = 'Injective',
OSMOSIS = 'Osmosis',
NEUTRON = 'Neutron',
SEI = 'Sei',
TERRA = 'Terra',
DISCORD = 'Pyth Discord',
}

Expand Down
7 changes: 2 additions & 5 deletions frontend/components/EcosystemConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Ecosystem } from './Ecosystem'
import { AptosWalletButton } from './wallets/Aptos'
import { CosmosWalletButton } from './wallets/Cosmos'
import { EVMWalletButton } from './wallets/EVM'
import { SeiWalletButton } from './wallets/Sei'
import { SolanaWalletButton } from './wallets/Solana'
import { SuiWalletButton } from './wallets/Sui'

Expand All @@ -29,10 +28,10 @@ export function EcosystemConnectButton({
isInjective={true}
/>
)
case Ecosystem.NEUTRON:
case Ecosystem.TERRA:
return (
<CosmosWalletButton
chainName="neutron"
chainName="terra"
disableOnConnect={disableOnConnect}
/>
)
Expand All @@ -43,8 +42,6 @@ export function EcosystemConnectButton({
disableOnConnect={disableOnConnect}
/>
)
case Ecosystem.SEI:
return <SeiWalletButton />
case Ecosystem.SOLANA:
return <SolanaWalletButton disableOnConnect={disableOnConnect} />
case Ecosystem.SUI:
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/wallets/Cosmos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import keplr from '@images/keplr.svg'

export const WALLET_NAME = 'keplr-extension'

export type ChainName = 'osmosis' | 'neutron' | 'sei'
export type ChainName = 'osmosis' | 'terra'

type CosmosWalletProviderProps = {
children: ReactNode
Expand Down
158 changes: 0 additions & 158 deletions frontend/components/wallets/Sei.tsx

This file was deleted.

16 changes: 4 additions & 12 deletions frontend/hooks/useGetEcosystemIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
import { useSession } from 'next-auth/react'
import { Ecosystem } from '@components/Ecosystem'
import { useCallback } from 'react'
import { useSeiWalletContext } from '@components/wallets/Sei'
import { getInjectiveAddress } from '../utils/getInjectiveAddress'

// It will return a function that can be used to get the identity of a given ecosystem
Expand All @@ -18,10 +17,7 @@ export function useGetEcosystemIdentity() {
const aptosAddress = useAptosAddress()
const evmAddress = useEVMAddress()
const osmosisAddress = useCosmosAddress('osmosis')
const neutronAddress = useCosmosAddress('neutron')

const { connectedSeiWallet } = useSeiWalletContext()
const seiAddress = useCosmosAddress('sei', connectedSeiWallet ?? undefined)
const terraAddress = useCosmosAddress('terra')
const solanaAddress = useSolanaAddress()
const suiAddress = useSuiAddress()
const { data } = useSession()
Expand All @@ -38,14 +34,11 @@ export function useGetEcosystemIdentity() {
case Ecosystem.INJECTIVE:
return evmAddress ? getInjectiveAddress(evmAddress) : undefined

case Ecosystem.NEUTRON:
return neutronAddress

case Ecosystem.OSMOSIS:
return osmosisAddress

case Ecosystem.SEI:
return seiAddress
case Ecosystem.TERRA:
return terraAddress

case Ecosystem.SOLANA:
return solanaAddress
Expand All @@ -61,9 +54,8 @@ export function useGetEcosystemIdentity() {
aptosAddress,
data?.user?.hashedUserId,
evmAddress,
neutronAddress,
osmosisAddress,
seiAddress,
terraAddress,
solanaAddress,
suiAddress,
]
Expand Down
14 changes: 3 additions & 11 deletions frontend/hooks/useSignMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Ecosystem } from '@components/Ecosystem'
import { fetchDiscordSignedMessage } from 'utils/api'
import { useTokenDispenserProvider } from './useTokenDispenserProvider'
import { ChainName } from '@components/wallets/Cosmos'
import { useSeiWalletContext } from '@components/wallets/Sei'

// SignMessageFn signs the message and returns it.
// It will return undefined:
Expand Down Expand Up @@ -188,12 +187,7 @@ export function useSignMessage(ecosystem: Ecosystem): SignMessageFn {
const aptosSignMessageFn = useAptosSignMessage()
const evmSignMessageFn = useEVMSignMessage()
const osmosisSignMessageFn = useCosmosSignMessage('osmosis')
const neutronSignMessageFn = useCosmosSignMessage('neutron')
const { connectedSeiWallet } = useSeiWalletContext()
const seiSignMessageFn = useCosmosSignMessage(
'sei',
connectedSeiWallet ?? undefined
)
const terraSignMessageFn = useCosmosSignMessage('terra')
const suiSignMessageFn = useSuiSignMessage()
const solanaSignMessageFn = useSolanaSignMessage()
const discordSignMessageFn = useDiscordSignMessage()
Expand All @@ -205,12 +199,10 @@ export function useSignMessage(ecosystem: Ecosystem): SignMessageFn {
return evmSignMessageFn
case Ecosystem.INJECTIVE:
return evmSignMessageFn
case Ecosystem.NEUTRON:
return neutronSignMessageFn
case Ecosystem.TERRA:
return terraSignMessageFn
case Ecosystem.OSMOSIS:
return osmosisSignMessageFn
case Ecosystem.SEI:
return seiSignMessageFn
case Ecosystem.SOLANA:
return solanaSignMessageFn
case Ecosystem.SUI:
Expand Down
12 changes: 6 additions & 6 deletions frontend/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export function middleware(req) {
`

// NextResponse object does not have a body property so we use Response instead
return new Response(body, {
status: 200,
headers: {
'Content-Type': 'text/html',
},
})
// return new Response(body, {
// status: 200,
// headers: {
// 'Content-Type': 'text/html',
// },
// })
}
55 changes: 26 additions & 29 deletions frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { SessionProvider } from 'next-auth/react'
import { EcosystemProviders } from '@components/Ecosystem'

import '../styles/globals.css'
import { SeiProvider } from '@components/wallets/Sei'
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
import { Layout } from '@components/Layout'
import { Disclaimer } from '@components/modal/Disclaimer'
Expand Down Expand Up @@ -104,35 +103,33 @@ const App: FC<AppProps> = ({ Component, pageProps }: AppProps) => {
<SuiWalletProvider>
<EVMWalletProvider>
<CosmosWalletProvider>
<SeiProvider>
{/* WARN: EcosystemProviders might use wallet provider addresses and hence
They should be inside all those providers. */}
<EcosystemProviders>
<Layout>
<NextSeo
title="Pyth Network Retrospective Airdrop"
description="This is the official claim webpage for the Pyth Network Retrospective Airdrop program."
/>
<Component {...pageProps} />
</Layout>
<Toaster
position="bottom-left"
toastOptions={{
style: {
wordBreak: 'break-word',
},
}}
reverseOrder={false}
{/* WARN: EcosystemProviders might use wallet provider addresses and hence
They should be inside all those providers. */}
<EcosystemProviders>
<Layout>
<NextSeo
title="Pyth Network Retrospective Airdrop"
description="This is the official claim webpage for the Pyth Network Retrospective Airdrop program."
/>
<Disclaimer
showModal={!disclaimerWasRead}
onAgree={() => {
DisclaimerCheckStore.set('true')
setDisclaimerWasRead(true)
}}
/>
</EcosystemProviders>
</SeiProvider>
<Component {...pageProps} />
</Layout>
<Toaster
position="bottom-left"
toastOptions={{
style: {
wordBreak: 'break-word',
},
}}
reverseOrder={false}
/>
<Disclaimer
showModal={!disclaimerWasRead}
onAgree={() => {
DisclaimerCheckStore.set('true')
setDisclaimerWasRead(true)
}}
/>
</EcosystemProviders>
</CosmosWalletProvider>
</EVMWalletProvider>
</SuiWalletProvider>
Expand Down
2 changes: 1 addition & 1 deletion frontend/scripts/populate_from_csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const DISCORD_DEV_CLAIMS = 'discord_dev.csv'

const NFT_CLAIMS = 'nft.csv'

const COSMWASM_CHAIN_LIST = ['neutron', 'osmosis', 'sei']
const COSMWASM_CHAIN_LIST = ['terra', 'osmosis']

function checkClaimsMatchEvmBreakdown(
claimInfos: ClaimInfo[],
Expand Down
Loading

0 comments on commit 6b1d6b8

Please sign in to comment.