Skip to content

Commit

Permalink
Merge pull request #1730 from sushi-labs/feat/apechain
Browse files Browse the repository at this point in the history
feat: apechain config
  • Loading branch information
matthewlilley authored Oct 30, 2024
2 parents 1668637 + cc391d2 commit 1199ac9
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 57 deletions.
2 changes: 1 addition & 1 deletion apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"class-variance-authority": "0.7.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"sushi": "4.0.2"
"sushi": "4.1.9"
},
"devDependencies": {
"@storybook/addon-a11y": "7.4.6",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"react-window": "1.8.7",
"sharp": "^0.33.5",
"strapi-sdk-js": "2.3.3",
"sushi": "4.0.5",
"sushi": "4.1.9",
"swr": "2.1.5",
"tiny-invariant": "1.3.1",
"tronweb": "5.3.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const DISABLED_CHAIN_IDS = [
// NonStandardChainId.TRON,
] as const

export const NEW_CHAIN_IDS = [] as const
export const NEW_CHAIN_IDS = [ChainId.APE] as const

const PREFERRED_CHAINID_ORDER = [
...NEW_CHAIN_IDS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import { createErrorToast, createToast } from '@sushiswap/notifications'
import { useCallback, useMemo, useState } from 'react'
import { erc20Abi_approve } from 'sushi/abi'
import { Token } from 'sushi/currency'
import { Address, UserRejectedRequestError, erc20Abi } from 'viem'
import { Address, UserRejectedRequestError } from 'viem'
import { usePublicClient, useSimulateContract, useWriteContract } from 'wagmi'
import { SendTransactionReturnType } from 'wagmi/actions'

Expand All @@ -22,7 +23,7 @@ export const useTokenRevokeApproval = ({
const client = usePublicClient()
const { data: simulation } = useSimulateContract({
address: token?.wrapped.address as Address,
abi: erc20Abi,
abi: erc20Abi_approve,
chainId: token?.chainId,
functionName: 'approve',
args: [spender, 0n],
Expand Down
2 changes: 1 addition & 1 deletion packages/graph-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"graphql": "16.6.0",
"graphql-request": "7.1.0",
"json-bigint": "1.0.0",
"sushi": "4.0.5",
"sushi": "4.1.9",
"viem": "2.21.4"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is auto-generated by scripts/update-data-api-types.ts
import type { ChainId } from 'sushi/chain'

export const TokenListChainIds = [42161,42170,43114,8453,288,56288,56,42220,1,250,122,100,11235,1666600000,1284,1285,137,534352,2222,1088,199,314,7000,1116,108,10,59144,1101,81457,2046399126,30,11155111,25,5000,324] as const
export const TokenListChainIds = [42161,42170,43114,8453,288,56288,56,42220,1,250,122,100,11235,1666600000,1284,1285,137,534352,2222,1088,199,314,7000,1116,108,10,59144,1101,81457,2046399126,30,11155111,25,5000,324,169,34443,167000,810180,33139] as const
export type TokenListChainId = typeof TokenListChainIds[number]
export function isTokenListChainId(value: ChainId): value is TokenListChainId {return TokenListChainIds.includes(value as TokenListChainId)}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is auto-generated by scripts/update-data-api-types.ts
import type { ChainId } from 'sushi/chain'

export const TrendingTokensChainIds = [42161,42170,43114,8453,288,56288,56,42220,1,250,122,100,1666600000,1284,137,534352,2222,1088,199,7000,1116,108,10,59144,1101,81457,2046399126,30,25,5000,324] as const
export const TrendingTokensChainIds = [42161,42170,43114,8453,288,56288,56,42220,1,250,122,100,1666600000,1284,137,534352,2222,1088,199,7000,1116,108,10,59144,1101,81457,2046399126,30,25,5000,324,169,34443,167000,810180,33139] as const
export type TrendingTokensChainId = typeof TrendingTokensChainIds[number]
export function isTrendingTokensChainId(value: ChainId): value is TrendingTokensChainId {return TrendingTokensChainIds.includes(value as TrendingTokensChainId)}
2 changes: 1 addition & 1 deletion packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@types/react-dom": "18.2.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"sushi": "4.0.5",
"sushi": "4.1.9",
"tailwindcss": "3.3.2",
"typescript": "5.5.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/notifications/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@tsconfig/strictest": "2.0.2",
"@types/react": "18.2.14",
"@types/react-dom": "18.2.6",
"sushi": "4.0.5",
"sushi": "4.1.9",
"typescript": "5.5.4"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/steer-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"dependencies": {
"@steerprotocol/contracts": "2.1.0-beta.14",
"sushi": "4.0.5",
"sushi": "4.1.9",
"viem": "2.21.4"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"postcss": "8.4.23",
"react": "18.2.0",
"react-dom": "18.2.0",
"sushi": "4.0.5",
"sushi": "4.1.9",
"tailwindcss": "3.3.2",
"typescript": "5.5.4",
"wagmi": "2.12.10"
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/currency/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const ZetaLogo = 'zeta.svg'
const CroLogo = 'cronos.svg'
const BitcoinLogo = 'bitcoin.svg'
const MntLogo = 'mntl.svg'
const ApeLogo = 'ape.svg'

const LOGO: Record<number, string> = {
[ChainId.ETHEREUM]: EthereumLogo,
Expand Down Expand Up @@ -86,6 +87,7 @@ const LOGO: Record<number, string> = {
[ChainId.BLAST]: EthereumLogo,
[ChainId.ROOTSTOCK]: BitcoinLogo,
[ChainId.MANTLE]: MntLogo,
[ChainId.APE]: ApeLogo,
}

// function djb2(str: string) {
Expand Down
12 changes: 12 additions & 0 deletions packages/ui/src/icons/network/circle/ApeCircle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as React from 'react'

import { ApeNaked } from '../naked/ApeNaked'

import { IconComponent } from '../../../types'

export const ApeCircle: IconComponent = (props) => (
<ApeNaked
{...props}
circle={<rect width="30" height="30" rx="15" fill="#fff" />}
/>
)
3 changes: 3 additions & 0 deletions packages/ui/src/icons/network/circle/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChainId } from 'sushi/chain'

import { IconComponent } from '../../../types'
import { ApeCircle } from './ApeCircle'
import { AptosCircle } from './AptosCircle'
import { ArbitrumCircle } from './ArbitrumCircle'
import { ArbitrumNovaCircle } from './ArbitrumNovaCircle'
Expand Down Expand Up @@ -43,6 +44,7 @@ import { TronCircle } from './TronCircle'
import { ZKSyncCircle } from './ZKSyncCircle'
import { ZetaChainCircle } from './ZetaChainCircle'

export * from './ApeCircle'
export * from './AptosCircle'
export * from './ArbitrumCircle'
export * from './ArbitrumNovaCircle'
Expand Down Expand Up @@ -127,6 +129,7 @@ export const NETWORK_CIRCLE_ICON: Partial<
[ChainId.ROOTSTOCK]: RootstockCircle,
[ChainId.CRONOS]: CronosCircle,
[ChainId.MANTLE]: MantleCircle,
[ChainId.APE]: ApeCircle,
aptos: AptosCircle,
tron: TronCircle,
}
19 changes: 19 additions & 0 deletions packages/ui/src/icons/network/naked/ApeNaked.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react'

import { NakedNetworkIconComponent } from '../../../types'

export const ApeNaked: NakedNetworkIconComponent = ({ circle, ...props }) => (
<svg
viewBox="0 0 30 30"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
{circle}
<path
fillRule="evenodd"
d="M10.075 9.242H8.001L6.663 20.365h1.669l.195-2.42h.932l.195 2.42h1.76zm-1.428 7.23.18-2.285.136-1.924h.045l.135 1.924.196 2.285zm4.663 3.893h1.79v-4.193h.556c1.278 0 2.06-.752 2.06-2.09v-2.735c0-1.353-.782-2.105-2.06-2.105H13.31zm2.195-5.531h-.391V10.58h.39c.302 0 .422.27.422.767v2.735c0 .481-.12.752-.421.752m4.27-5.592v11.123h3.487v-1.473h-1.698V15.48h1.518v-1.473h-1.518v-3.292h1.698V9.242z"
fill="#0054FA"
/>
</svg>
)
3 changes: 3 additions & 0 deletions packages/ui/src/icons/network/naked/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChainId } from 'sushi/chain'

import { IconComponent } from '../../../types'
import { ApeNaked } from './ApeNaked'
import { AptosNaked } from './AptosNaked'
import { ArbitrumNaked } from './ArbitrumNaked'
import { ArbitrumNovaNaked } from './ArbitrumNovaNaked'
Expand Down Expand Up @@ -43,6 +44,7 @@ import { TronNaked } from './TronNaked'
import { ZKSyncNaked } from './ZKSyncNaked'
import { ZetaChainNaked } from './ZetaChainNaked'

export * from './ApeNaked'
export * from './AptosNaked'
export * from './ArbitrumNaked'
export * from './ArbitrumNovaNaked'
Expand Down Expand Up @@ -126,6 +128,7 @@ export const NETWORK_NAKED_ICON: Partial<
[ChainId.ROOTSTOCK]: RootstockNaked,
[ChainId.CRONOS]: CronosNaked,
[ChainId.MANTLE]: MantleNaked,
[ChainId.APE]: ApeNaked,
aptos: AptosNaked,
tron: TronNaked,
}
65 changes: 20 additions & 45 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1199ac9

Please sign in to comment.