Skip to content

Commit

Permalink
[fe] Remove Neutron and Sei, add Terra Classic (#17)
Browse files Browse the repository at this point in the history
* Remove Neutron and Sei, add Terra Classic

* Fix terra hdPath for test wallet

* Update admissible chains array from cosmos in the ecosystems module

* Apply prettier

* Fix cosmos authorized chains test

* Fix cosmos chain list

* Apply prettier

* Lock prettier version to the same used by the prettier action hook
  • Loading branch information
M-Picco authored Mar 20, 2024
1 parent 0017f17 commit ae80e0c
Show file tree
Hide file tree
Showing 21 changed files with 1,254 additions and 651 deletions.
11 changes: 7 additions & 4 deletions frontend/claim_sdk/testWallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { ethers } from 'ethers'
import fs from 'fs'
import { AminoSignResponse, Secp256k1HdWallet } from '@cosmjs/amino'
import { HdPath, stringToPath } from '@cosmjs/crypto'
import { makeADR36AminoSignDoc } from '@keplr-wallet/cosmos'
import NodeWallet from '@coral-xyz/anchor/dist/cjs/nodewallet'
import { Keypair, PublicKey } from '@solana/web3.js'
Expand Down Expand Up @@ -90,9 +91,10 @@ 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', [
stringToPath("m/44'/330'/0'/0/0"),
]),
]
result['injective'] = [TestEvmWallet.fromKeyfile(cosmosPrivateKeyPath, true)]

Expand Down Expand Up @@ -150,14 +152,15 @@ export class TestCosmWasmWallet implements TestWallet {
*/
static async fromKeyFile(
keyFile: string,
chainId?: string
prefix?: string,
hdPaths?: HdPath[]
): Promise<TestCosmWasmWallet> {
const jsonContent = fs.readFileSync(keyFile, 'utf8')

const mnemonic = JSON.parse(jsonContent).mnemonic
const wallet: Secp256k1HdWallet = await Secp256k1HdWallet.fromMnemonic(
mnemonic,
chainId ? { prefix: chainId } : {}
{ prefix, hdPaths }
)

const { address: addressStr } = (await wallet.getAccounts())[0]
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/DiscordButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const newTab = (url: string, title: string) => {

export function DiscordButton({ disableOnAuth }: DiscordButtonProps) {
// TODO update logic to get discord data from lambda function execution
const { data = {}, status = '' } = {} as any;
const { data = {}, status = '' } = {} as any

const { logo, text } = useMemo(() => {
if (status === 'authenticated')
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
109 changes: 55 additions & 54 deletions frontend/components/modal/Disclaimer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export function Disclaimer({ onAgree, showModal }: DisclaimerProps) {
</p>
<ol className="claim-ol">
<li>
You agree and acknowledge that you have the sole responsibility and
liability for all taxes in connection with your participation in the
Airdrop and you should consult a tax advisor.
You agree and acknowledge that you have the sole responsibility
and liability for all taxes in connection with your participation
in the Airdrop and you should consult a tax advisor.
</li>
<li>
You agree and acknowledge that you are solely responsible for
Expand All @@ -40,78 +40,78 @@ export function Disclaimer({ onAgree, showModal }: DisclaimerProps) {
</li>
<li>
You agree and acknowledge that you (a) may receive tokens for free
via the Airdrop (other than applicable taxes, if any), (b) were not
previously promised any tokens, and (c) took no action in
via the Airdrop (other than applicable taxes, if any), (b) were
not previously promised any tokens, and (c) took no action in
anticipation of or in reliance on receiving any tokens or an
Airdrop.
</li>
<li>
Your eligibility to receive Airdrop tokens or participate in the
Airdrop is subject to our sole discretion. To the extent you believe
you should have received any airdropped tokens based on any
documentation or points system released by us from time to time,
such documentation does not entitle you to any tokens or to
Airdrop is subject to our sole discretion. To the extent you
believe you should have received any airdropped tokens based on
any documentation or points system released by us from time to
time, such documentation does not entitle you to any tokens or to
participate in the Airdrop and therefore you have no claim for any
such tokens.  You agree not to engage in any activities that are
designed to obtain more Airdrop tokens than you are entitled to. You
agree that you are the legal owner of the blockchain address that
you use to access or participate in the Airdrop.
designed to obtain more Airdrop tokens than you are entitled to.
You agree that you are the legal owner of the blockchain address
that you use to access or participate in the Airdrop.
</li>
<li>
You agree and acknowledge that you are not a Prohibited Person and
you will not use a VPN or other tool to circumvent any geoblock or
other restrictions that we may have implemented for Airdrop
recipients. Any such circumvention, or attempted circumvention, may
permanently disqualify you from participation in the Airdrop in our
discretion.
recipients. Any such circumvention, or attempted circumvention,
may permanently disqualify you from participation in the Airdrop
in our discretion.
</li>
<li>
To participate in the Airdrop, you will need to connect a compatible
third-party digital wallet (“Wallet”). By using a
Wallet, you agree that you are using the Wallet under the terms and
conditions of the applicable third-party provider of such Wallet.
Wallets are not associated with, maintained by, supported by or
affiliated with the Organization. When you interact with the
Services, you retain control over your digital assets at all times.
We accept no responsibility or liability to you in connection with
your use of a Wallet, and we make no representations or warranties
regarding how the Services will operate or be compatible with any
specific Wallet.{" "}
To participate in the Airdrop, you will need to connect a
compatible third-party digital wallet (“Wallet”). By using a
Wallet, you agree that you are using the Wallet under the terms
and conditions of the applicable third-party provider of such
Wallet. Wallets are not associated with, maintained by, supported
by or affiliated with the Organization. When you interact with the
Services, you retain control over your digital assets at all
times. We accept no responsibility or liability to you in
connection with your use of a Wallet, and we make no
representations or warranties regarding how the Services will
operate or be compatible with any specific Wallet.{' '}
<strong>
The private keys necessary to access the assets held in a Wallet
are not held by the Organization. The Organization has no ability
to help you access or recover your private keys and/or seed
phrases for your Wallet. You are solely responsible for
are not held by the Organization. The Organization has no
ability to help you access or recover your private keys and/or
seed phrases for your Wallet. You are solely responsible for
maintaining the confidentiality of your private keys and you are
responsible for any transactions signed with your private keys
</strong>
</li>
<li>
You agree and acknowledge that if you are unable to claim an Airdrop
due to technical bugs, smart contract issue, gas fees, wallet
incompatibility, loss of access to a wallet or the keys thereto, or
for any other reason, you will have no recourse or claim against us
or our affiliates and that we and our affiliates will not bear any
liability.
You agree and acknowledge that if you are unable to claim an
Airdrop due to technical bugs, smart contract issue, gas fees,
wallet incompatibility, loss of access to a wallet or the keys
thereto, or for any other reason, you will have no recourse or
claim against us or our affiliates and that we and our affiliates
will not bear any liability.
</li>
<li>
You agree and acknowledge that claiming an Airdrop may require
reliance on or an integration with third party products (e.g., a
wallet or an unaffiliated network or blockchain) that we do not 
control. In the event that you are unable to access such products or
integrations, or if they fail for any reason, and you are unable to
participate in an Airdrop or claim Airdrop tokens, you will have no
recourse or claim against us or our affiliates and we and our
affiliates will not bear any liability.
control. In the event that you are unable to access such products
or integrations, or if they fail for any reason, and you are
unable to participate in an Airdrop or claim Airdrop tokens, you
will have no recourse or claim against us or our affiliates and we
and our affiliates will not bear any liability.
</li>
<li>
You agree and acknowledge that the regulatory regime governing
blockchain technologies, cryptocurrencies and other digital assets
is uncertain, that new regulations or policies may materially
adversely affect the potential utility or value of such
cryptocurrencies and digital assets, and that there are risks of new
taxation related to the purchase or sale of cryptocurrencies and
other digital assets.
cryptocurrencies and digital assets, and that there are risks of
new taxation related to the purchase or sale of cryptocurrencies
and other digital assets.
</li>
<li>
You agree and acknowledge that cryptocurrencies and other similar
Expand All @@ -120,17 +120,18 @@ export function Disclaimer({ onAgree, showModal }: DisclaimerProps) {
</li>
</ol>

<p>
These Airdrop Terms and the General Terms contain the entire agreement
between you and the Organization regarding the Airdrop, and supersede
all prior and contemporaneous understandings between the parties
regarding the Airdrop. We may modify these Airdrop Terms from time to
time in which case we will update the “Last Revised” date at the top
of these Airdrop Terms. The updated Airdrop Terms will be effective as
of the time of posting, or such later date as may be specified in the
updated Airdrop Terms. Your continued access or participation in the
Airdrop after the modifications have become effective will be deemed
your acceptance of the modified Airdrop Terms.{" "}
<p>
These Airdrop Terms and the General Terms contain the entire
agreement between you and the Organization regarding the Airdrop,
and supersede all prior and contemporaneous understandings between
the parties regarding the Airdrop. We may modify these Airdrop Terms
from time to time in which case we will update the “Last Revised”
date at the top of these Airdrop Terms. The updated Airdrop Terms
will be effective as of the time of posting, or such later date as
may be specified in the updated Airdrop Terms. Your continued access
or participation in the Airdrop after the modifications have become
effective will be deemed your acceptance of the modified Airdrop
Terms.{' '}
</p>
</div>
<div className="[&>button]:w-[200px] flex min-h-fit flex-col items-stretch gap-4 py-5 px-10 text-sm">
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
Loading

0 comments on commit ae80e0c

Please sign in to comment.