Skip to content

Commit

Permalink
feat : Add sonic chain (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunspirit99 authored Dec 17, 2024
1 parent f4f81bc commit b3588ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/valueobject/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const (
ChainIDScroll ChainID = 534352
ChainIDBlast ChainID = 81457
ChainIDMantle ChainID = 5000
ChainIDSonic ChainID = 146

// ChainIDSolana is currently used in case of store price to db, that we should transform token addr into lowercase or not.
ChainIDSolana ChainID = 0
Expand Down Expand Up @@ -109,6 +110,8 @@ func ToString(chainID ChainID) (string, error) {
return "blast", nil
case 5000:
return "mantle", nil
case 146:
return "sonic", nil
case 0:
return "solana", nil
default:
Expand Down
6 changes: 6 additions & 0 deletions pkg/valueobject/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ var (
ExchangeMxTrading Exchange = "mx-trading"
ExchangeLO1inch Exchange = "lo1inch"
ExchangeVirtualFun Exchange = "virtual-fun"
ExchangeMetropolis Exchange = "metropolis"
ExchangeMetropolisLB Exchange = "metropolis-lb"
ExchangeSonicMarket Exchange = "sonic-market"
)

var AMMSourceSet = map[Exchange]struct{}{
Expand Down Expand Up @@ -698,6 +701,9 @@ var AMMSourceSet = map[Exchange]struct{}{
ExchangeScribe: {},
ExchangeHorizonIntegral: {},
ExchangeVirtualFun: {},
ExchangeMetropolis: {},
ExchangeMetropolisLB: {},
ExchangeSonicMarket: {},
}

func IsAMMSource(exchange Exchange) bool {
Expand Down
1 change: 1 addition & 0 deletions pkg/valueobject/weth.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var WETHByChainID = map[ChainID]string{
ChainIDScroll: "0x5300000000000000000000000000000000000004",
ChainIDBlast: "0x4300000000000000000000000000000000000004",
ChainIDMantle: "0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8",
ChainIDSonic: "0x309C92261178fA0CF748A855e90Ae73FDb79EBc7",
}

// WrapETHLower wraps, if applicable, native token to wrapped token; and then lowercase it.
Expand Down

0 comments on commit b3588ee

Please sign in to comment.