Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,8 @@ type PaymentOption @entity {
# Payment token details
tokenAddress: Bytes!
tokenType: CoinType!
tokenName: String!
tokenSymbol: String!

# Hops from this payment token to the target coin (when buying)
# Or from target coin to this payment token (when selling)
Expand Down
12 changes: 12 additions & 0 deletions apps/subgraph/src/utils/coinInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export namespace CoinType {
export class CoinInfo {
address: Bytes
type: string
name: string
symbol: string
pairedToken: Bytes | null
poolId: Bytes | null // Uniswap V4 pool identifier (from either poolId or poolKeyHash)
fee: BigInt | null
Expand All @@ -27,6 +29,8 @@ export class CoinInfo {
constructor(
address: Bytes,
type: string,
name: string,
symbol: string,
pairedToken: Bytes | null,
poolId: Bytes | null,
fee: BigInt | null,
Expand All @@ -35,6 +39,8 @@ export class CoinInfo {
) {
this.address = address
this.type = type
this.name = name
this.symbol = symbol
this.pairedToken = pairedToken
this.poolId = poolId
this.fee = fee
Expand All @@ -55,6 +61,8 @@ export function loadCoinInfo(tokenAddress: Bytes): CoinInfo | null {
return new CoinInfo(
tokenAddress,
CoinType.WETH,
'Wrapped Ether',
'WETH',
null, // WETH has no pairedToken
null, // WETH has no pool
null,
Expand All @@ -69,6 +77,8 @@ export function loadCoinInfo(tokenAddress: Bytes): CoinInfo | null {
return new CoinInfo(
zoraCoin.coinAddress,
CoinType.ZORA_COIN,
zoraCoin.name,
zoraCoin.symbol,
zoraCoin.currency,
zoraCoin.poolKeyHash, // poolKeyHash is the Uniswap V4 pool identifier
zoraCoin.poolFee,
Expand All @@ -83,6 +93,8 @@ export function loadCoinInfo(tokenAddress: Bytes): CoinInfo | null {
return new CoinInfo(
clankerToken.tokenAddress,
CoinType.CLANKER_TOKEN,
clankerToken.tokenName,
clankerToken.tokenSymbol,
clankerToken.pairedToken,
clankerToken.poolId, // poolId is the Uniswap V4 pool identifier
DYNAMIC_FEE_FLAG,
Expand Down
6 changes: 6 additions & 0 deletions apps/subgraph/src/utils/swapPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,13 @@ export function buildSwapRoute(coinAddress: Bytes, timestamp: BigInt): SwapRoute

// Determine token type
let tokenType = CoinType.WETH
let tokenName = 'Wrapped Ether'
let tokenSymbol = 'WETH'
const info = loadCoinInfo(tokenBytes)
if (info) {
tokenType = info.type
tokenName = info.name
tokenSymbol = info.symbol
}

// Create payment option
Expand All @@ -253,6 +257,8 @@ export function buildSwapRoute(coinAddress: Bytes, timestamp: BigInt): SwapRoute
option.route = routeId
option.tokenAddress = tokenBytes
option.tokenType = tokenType
option.tokenName = tokenName
option.tokenSymbol = tokenSymbol
option.startHopIndex = startHopIndex
option.endHopIndex = endHopIndex
option.isDirectSwap = endHopIndex - startHopIndex == 0 // Single hop = direct swap
Expand Down
89 changes: 0 additions & 89 deletions apps/web/src/pages/api/coins/swap-options.ts

This file was deleted.

6 changes: 4 additions & 2 deletions packages/dao-ui/src/components/Cards/Cards.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { style } from '@vanilla-extract/css'

export const card = style([
{
transition: 'transform 0.2s ease, box-shadow 0.2s ease',
position: 'relative',
top: 0,
transition: 'top 0.2s ease, box-shadow 0.2s ease',
border: `2px solid ${color.border}`,
':hover': {
transform: 'translateY(-2px)',
top: -2,
boxShadow: `0 4px 12px ${theme.colors.ghostHover}`,
},
},
Expand Down
1 change: 0 additions & 1 deletion packages/hooks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export * from './useQueryParams'
export * from './useScrollDirection'
export * from './useStreamData'
export * from './useSwapOptions'
export * from './useSwapPath'
export * from './useSwapQuote'
export * from './useTimeout'
export * from './useTokenBalances'
Expand Down
Loading
Loading