Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into tron-new
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMasayoshi committed Sep 13, 2024
2 parents 2895d94 + fd88d7b commit 4a089a6
Show file tree
Hide file tree
Showing 98 changed files with 2,778 additions and 2,425 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apps-web-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
block-number: [60306923]
block-number: [61755107]
chain-id: [137]
node-version: [20]
pnpm-version: [9.4.0]
Expand Down
11 changes: 11 additions & 0 deletions apis/extractor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,19 @@ Sentry.init({
enableTracing: true,
tracesSampleRate: 1,
//debug: process.env['SENTRY_ENVIRONMENT'] !== 'production',
// Called for message and error events
beforeSend(event) {
// Modify or drop the event here
if (event.user) {
// Don't send user's email address for example
// delete event.user.email
}
return event
},
})

Sentry.setTag('chainId', CHAIN_ID)

Logger.setLogsExternalHandler(
(
msg: string,
Expand Down
24 changes: 23 additions & 1 deletion apis/router/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ async function start() {
dsn: SENTRY_DSN,
environment: SENTRY_ENVIRONMENT,
integrations: [
// Sentry.thirdPartyErrorFilterIntegration({
// // Specify the application keys that you specified in the Sentry bundler plugin
// filterKeys: ['router'],

// // Defines how to handle errors that contain third party stack frames.
// // Possible values are:
// // - 'drop-error-if-contains-third-party-frames'
// // - 'drop-error-if-exclusively-contains-third-party-frames'
// // - 'apply-tag-if-contains-third-party-frames'
// // - 'apply-tag-if-exclusively-contains-third-party-frames'
// behaviour: 'apply-tag-if-contains-third-party-frames',
// }),
// enable HTTP calls tracing
new Sentry.Integrations.Http({
breadcrumbs: true,
Expand All @@ -64,8 +76,18 @@ async function start() {
// Performance Monitoring
enableTracing: true,
tracesSampleRate: 1,
//debug: process.env['SENTRY_ENVIRONMENT'] !== 'production',
// Called for message and error events
beforeSend(event) {
// Modify or drop the event here
if (event.user) {
// Don't send user's email address for example
// delete event.user.email
}
return event
},
})

Sentry.setTag('chainId', CHAIN_ID)
Logger.setLogsExternalHandler(
(
msg: string,
Expand Down
6 changes: 3 additions & 3 deletions apps/web/.env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ANVIL_BLOCK_NUMBER=60306923
ANVIL_FORK_URL=https://polygon-mainnet.g.alchemy.com/v2/
ANVIL_BLOCK_NUMBER=61755334
ANVIL_FORK_URL=https://lb.drpc.org/ogrpc?network=polygon&dkey=
ANVIL_PORT=8545
EDGE_CONFIG=
EDGE_CONFIG="https://edge-config.vercel.com"
NEXT_PUBLIC_APP_ENV="test"
NEXT_PUBLIC_CHAIN_ID=137
15 changes: 11 additions & 4 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,15 @@ const nextConfig = bundleAnalyzer({
},
})

export default withSentryConfig(withAxiom(nextConfig), {
export default withAxiom(withSentryConfig(nextConfig), {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

org: 'sushi-j9',
project: 'evm',
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,

// An auth token is required for uploading source maps.
authToken: process.env.SENTRY_AUTH_TOKEN,

// Only print logs for uploading source maps in CI
silent: !process.env.CI,
Expand All @@ -121,11 +124,15 @@ export default withSentryConfig(withAxiom(nextConfig), {
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
disableLogger: process.NODE_ENV === 'production',

// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,

unstable_sentryWebpackPluginOptions: {
applicationKey: 'web',
},
})
16 changes: 10 additions & 6 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"test": "npx playwright test -c test/playwright.config.ts"
},
"dependencies": {
"@aptos-labs/ts-sdk": "^1.22.1",
"@aptos-labs/wallet-adapter-core": "3.10.0",
"@aptos-labs/wallet-adapter-react": "2.3.1",
"@cloudinary/url-gen": "1.11.2",
Expand All @@ -26,14 +27,14 @@
"@layerzerolabs/scan-client": "0.0.6",
"@martianwallet/aptos-wallet-adapter": "^0.0.5",
"@msafe/aptos-wallet-adapter": "^1.1.3",
"@next/bundle-analyzer": "^14.2.3",
"@next/bundle-analyzer": "14.2.11",
"@octokit/auth-app": "4.0.7",
"@orbs-network/twap-ui-sushiswap": "1.1.57",
"@pontem/wallet-adapter-plugin": "^0.2.1",
"@radix-ui/react-slot": "1.0.2",
"@rainbow-me/rainbowkit": "2.1.3",
"@rainbow-me/rainbowkit": "2.1.6",
"@rise-wallet/wallet-adapter": "^0.1.2",
"@sentry/nextjs": "8.13.0",
"@sentry/nextjs": "8.30.0",
"@snapshot-labs/snapshot.js": "^0.9.8",
"@sushiswap/bonds-sdk": "workspace:*",
"@sushiswap/client": "workspace:*",
Expand Down Expand Up @@ -77,7 +78,7 @@
"lodash.zip": "4.2.0",
"ms": "2.1.3",
"nanoid": "4.0.0",
"next": "14.2.3",
"next": "14.2.11",
"next-axiom": "1.5.0",
"next-themes": "0.2.1",
"octokit": "2.1.0",
Expand All @@ -101,7 +102,8 @@
},
"devDependencies": {
"@0xsquid/squid-types": "0.1.78",
"@next/eslint-plugin-next": "14.2.3",
"@next/env": "14.2.11",
"@next/eslint-plugin-next": "14.2.11",
"@playwright/test": "1.45.0",
"@sushiswap/jest-config": "workspace:*",
"@sushiswap/typescript-config": "workspace:*",
Expand All @@ -123,9 +125,11 @@
"@types/tryghost__content-api": "1.3.12",
"@viem/anvil": "0.0.10",
"autoprefixer": "10.4.14",
"eslint-config-next": "14.2.3",
"core-js": "3.38.1",
"eslint-config-next": "14.2.11",
"eslint-config-sushi": "workspace:*",
"postcss": "8.4.23",
"prool": "0.0.16",
"schema-dts": "^1.1.2",
"tailwindcss": "3.3.2",
"tsx": "^4.16.5",
Expand Down
15 changes: 14 additions & 1 deletion apps/web/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as Sentry from '@sentry/nextjs'

Sentry.init({
dsn: 'https://d15baeafe615a5dc057445e683b2c66c@o960777.ingest.us.sentry.io/4507504234659840',
dsn: 'https://28c197e66594eea8cf3014697e6fc0d3@o960777.ingest.us.sentry.io/4507941516410880',

enabled: process.env.NEXT_PUBLIC_APP_ENV !== 'test',

Expand All @@ -23,9 +23,22 @@ Sentry.init({

// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
Sentry.thirdPartyErrorFilterIntegration({
// Specify the application keys that you specified in the Sentry bundler plugin
filterKeys: ['web'],

// Defines how to handle errors that contain third party stack frames.
// Possible values are:
// - 'drop-error-if-contains-third-party-frames'
// - 'drop-error-if-exclusively-contains-third-party-frames'
// - 'apply-tag-if-contains-third-party-frames'
// - 'apply-tag-if-exclusively-contains-third-party-frames'
behaviour: 'apply-tag-if-contains-third-party-frames',
}),
Sentry.replayIntegration({
// Additional Replay configuration goes in here, for example:
maskAllText: false,
maskAllInputs: false,
blockAllMedia: false,
}),
],
Expand Down
2 changes: 1 addition & 1 deletion apps/web/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as Sentry from '@sentry/nextjs'

Sentry.init({
dsn: 'https://d15baeafe615a5dc057445e683b2c66c@o960777.ingest.us.sentry.io/4507504234659840',
dsn: 'https://28c197e66594eea8cf3014697e6fc0d3@o960777.ingest.us.sentry.io/4507941516410880',

enabled: process.env.NEXT_PUBLIC_APP_ENV !== 'test',

Expand Down
2 changes: 1 addition & 1 deletion apps/web/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as Sentry from '@sentry/nextjs'

Sentry.init({
dsn: 'https://d15baeafe615a5dc057445e683b2c66c@o960777.ingest.us.sentry.io/4507504234659840',
dsn: 'https://28c197e66594eea8cf3014697e6fc0d3@o960777.ingest.us.sentry.io/4507941516410880',

enabled: process.env.NEXT_PUBLIC_APP_ENV !== 'test',

Expand Down
8 changes: 3 additions & 5 deletions apps/web/src/app/(evm)/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import '@rainbow-me/rainbowkit/styles.css'

import { BaseProviders, OnramperProvider } from '@sushiswap/ui'
import { WagmiStoreVersionCheck } from 'src/lib/wagmi/components/wagmi-store-version-check'

import { QueryClientProvider } from '../../providers/query-client-provider'
import { WagmiConfig } from '../../providers/wagmi-provider'
import { WagmiProvider } from '../../providers/wagmi-provider'

export function Providers({
children,
Expand All @@ -15,9 +15,7 @@ export function Providers({
<BaseProviders>
<OnramperProvider>
<QueryClientProvider>
<WagmiConfig cookie={cookie}>
<WagmiStoreVersionCheck>{children}</WagmiStoreVersionCheck>
</WagmiConfig>
<WagmiProvider cookie={cookie}>{children}</WagmiProvider>
</QueryClientProvider>
</OnramperProvider>
</BaseProviders>
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(landing)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { HotJar, classNames } from '@sushiswap/ui'
import React from 'react'
import { QueryClientProvider } from 'src/providers/query-client-provider'
import { WagmiConfig } from 'src/providers/wagmi-provider'
import { WagmiProvider } from 'src/providers/wagmi-provider'
import { Header } from './header'

export default function LandingLayout({
children,
}: { children: React.ReactNode }) {
return (
<QueryClientProvider>
<WagmiConfig>
<WagmiProvider>
<div className={classNames('flex flex-col flex-1')}>
<Header />
<div className="flex flex-col flex-1">{children}</div>
</div>
<HotJar />
</WagmiConfig>
</WagmiProvider>
</QueryClientProvider>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import { useWallet } from '@aptos-labs/wallet-adapter-react'
import { Transition } from '@headlessui/react'
import { Button, Dots } from '@sushiswap/ui'
import { Provider } from 'aptos'
import { useParams } from 'next/navigation'
import { FC, Fragment, useState } from 'react'
import { networkNameToNetwork } from '~aptos/(common)/config/chains'
import { useNetwork } from '~aptos/(common)/lib/common/use-network'
import { Token } from '~aptos/(common)/lib/types/token'
import { createToast } from '~aptos/(common)/ui/toast'
import { Pool } from '~aptos/pool/lib/convert-pool-to-sushi-pool'
import { AddSectionStakeWidget } from './AddSectionStakeWidget'

interface AddSectionStakeProps {
pool: Pool
title?: string
token0: Token
token1: Token
Expand All @@ -28,7 +29,17 @@ export const AddSectionStake: FC<{
decimals: number | undefined
lpTokenName: string | undefined
price: number
}> = ({ title, token0, token1, balance, decimals, lpTokenName, price }) => {
pool: Pool
}> = ({
title,
token0,
token1,
balance,
decimals,
lpTokenName,
price,
pool,
}) => {
return (
<Transition
appear
Expand All @@ -41,6 +52,7 @@ export const AddSectionStake: FC<{
leaveTo="transform opacity-0"
>
<_AddSectionStake
pool={pool}
title={title}
token0={token0}
token1={token1}
Expand All @@ -61,10 +73,9 @@ const _AddSectionStake: FC<AddSectionStakeProps> = ({
decimals,
lpTokenName,
price,
pool,
}) => {
const [hover, setHover] = useState(false)
const router = useParams()
const tokenAddress = decodeURIComponent(router?.id as string)
const [value, setValue] = useState('')
const { signAndSubmitTransaction } = useWallet()

Expand All @@ -84,7 +95,7 @@ const _AddSectionStake: FC<AddSectionStakeProps> = ({
try {
const response = await signAndSubmitTransaction({
data: {
typeArguments: [`${swapContract}::swap::LPToken<${tokenAddress}>`],
typeArguments: [`${swapContract}::swap::LPToken<${pool.id}>`],
functionArguments: [parseInt(String(Number(value) * 10 ** decimals))],
function: `${masterchefContract}::masterchef::deposit`,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import {
WidgetHeader,
WidgetTitle,
} from '@sushiswap/ui'
import { useParams } from 'next/navigation'
import React, { FC, useEffect } from 'react'
import { DEFAULT_SLIPPAGE } from 'sushi/config'
import { usePool } from '~aptos/pool/lib/use-pool'
import { Pool } from '~aptos/pool/lib/convert-pool-to-sushi-pool'
import { useTokensFromPool } from '~aptos/pool/lib/use-tokens-from-pool'
import { PoolAddCurrencyInput } from '~aptos/pool/ui/pool/add/pool-add-currency-input'
import { PoolAddDepositButton } from '~aptos/pool/ui/pool/add/pool-add-deposit-button'
Expand All @@ -31,13 +30,9 @@ const buttonProps: ButtonProps = {
variant: 'outline',
}

export const AddSectionWidget: FC = () => {
export const AddSectionWidget: FC<{ pool?: Pool }> = ({ pool }) => {
usePoolPairs()

const router = useParams()
const tokenAddress = decodeURIComponent(router?.id as string)
const { data: pool } = usePool(tokenAddress)

const { token0, token1 } = useTokensFromPool(pool)

const { setToken0, setToken1 } = usePoolActions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CurrencyIcon } from '~aptos/(common)/ui/currency/currency-icon'
interface CardCurrencyAmountItemProps
extends React.HTMLAttributes<HTMLDivElement> {
isLoading?: boolean
currency: Token
currency?: Token
amount?: number
fiatValue?: string
}
Expand All @@ -24,7 +24,7 @@ const CardCurrencyAmountItem = React.forwardRef<
title={
<div className="font-medium flex items-center gap-2 text-muted-foreground">
<CurrencyIcon currency={currency} width={18} height={18} />
{currency.symbol}
{currency?.symbol}
</div>
}
ref={ref}
Expand Down
Loading

0 comments on commit 4a089a6

Please sign in to comment.