diff --git a/packages/explorer-ui/components/ChainChart/index.tsx b/packages/explorer-ui/components/ChainChart/index.tsx index 2c2ae7f9cc..e3c24de1fd 100644 --- a/packages/explorer-ui/components/ChainChart/index.tsx +++ b/packages/explorer-ui/components/ChainChart/index.tsx @@ -314,6 +314,12 @@ export const OverviewChart: React.FC = ({ stackId="a" fill={loading ? 'rgba(255, 255, 255, 0.1)' : '#FFEEDA'} /> + )} diff --git a/packages/explorer-ui/graphql/queries/index.ts b/packages/explorer-ui/graphql/queries/index.ts index efedc7b9ae..28389f8e36 100644 --- a/packages/explorer-ui/graphql/queries/index.ts +++ b/packages/explorer-ui/graphql/queries/index.ts @@ -210,6 +210,7 @@ export const DAILY_STATISTICS_BY_CHAIN = gql` base blast scroll + linea total } } diff --git a/packages/synapse-constants/constants/assets/chains/index.ts b/packages/synapse-constants/constants/assets/chains/index.ts index 734055888c..ea0e9e1205 100644 --- a/packages/synapse-constants/constants/assets/chains/index.ts +++ b/packages/synapse-constants/constants/assets/chains/index.ts @@ -17,3 +17,4 @@ export * as moonbeamImg from './moonbeam.svg' export * as moonriverImg from './moonriver.svg' export * as optimismImg from './optimism.svg' export * as polygonImg from './polygon.svg' +export * as lineaImg from './linea.svg' diff --git a/packages/synapse-constants/constants/assets/chains/linea.svg b/packages/synapse-constants/constants/assets/chains/linea.svg new file mode 100644 index 0000000000..33f1bb7bce --- /dev/null +++ b/packages/synapse-constants/constants/assets/chains/linea.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/synapse-constants/constants/assets/explorer/index.ts b/packages/synapse-constants/constants/assets/explorer/index.ts index 2322de0ddb..c826a27ea9 100644 --- a/packages/synapse-constants/constants/assets/explorer/index.ts +++ b/packages/synapse-constants/constants/assets/explorer/index.ts @@ -17,3 +17,5 @@ export * as moonbeamExplorerImg from './moonbeam.svg' export * as moonriverExplorerImg from './moonriver.svg' export * as dogeExplorerImg from './dogechain.svg' export * as baseExplorerImg from './basescan.svg' +export * as scrollExplorerImg from './scroll.svg' +export * as lineaExplorerImg from './linea.svg' diff --git a/packages/synapse-constants/constants/assets/explorer/linea.svg b/packages/synapse-constants/constants/assets/explorer/linea.svg new file mode 100644 index 0000000000..33f1bb7bce --- /dev/null +++ b/packages/synapse-constants/constants/assets/explorer/linea.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/synapse-constants/constants/bridgeMap.ts b/packages/synapse-constants/constants/bridgeMap.ts index 8257707cf1..2f002e5c53 100644 --- a/packages/synapse-constants/constants/bridgeMap.ts +++ b/packages/synapse-constants/constants/bridgeMap.ts @@ -167,6 +167,13 @@ export const BRIDGE_MAP = { destination: ['VSTA'], swappable: [], }, + '0xAdF7C35560035944e805D98fF17d58CDe2449389': { + decimals: 18, + symbol: 'SPEC', + origin: ['SPEC'], + destination: ['SPEC'], + swappable: [], + }, '0xBAac2B4491727D78D2b78815144570b9f2Fe8899': { decimals: 18, symbol: 'DOG', @@ -1233,6 +1240,13 @@ export const BRIDGE_MAP = { '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', ], }, + '0x96419929d7949D6A801A6909c145C8EEf6A40431': { + decimals: 18, + symbol: 'SPEC', + origin: ['SPEC'], + destination: ['SPEC'], + swappable: [], + }, '0xEB466342C4d449BC9f53A865D5Cb90586f405215': { decimals: 6, symbol: 'axlUSDC', diff --git a/packages/synapse-constants/constants/chains/index.ts b/packages/synapse-constants/constants/chains/index.ts index 9d0d62f9b3..d58ce89949 100644 --- a/packages/synapse-constants/constants/chains/index.ts +++ b/packages/synapse-constants/constants/chains/index.ts @@ -75,6 +75,7 @@ export const ChainId = { BASE: 8453, BLAST: 81457, SCROLL: 534352, + LINEA: 59144, AVALANCHE: 43114, DFK: 53935, AURORA: 1313161554, @@ -124,4 +125,7 @@ export const FASTBRIDGE_CONTRACTS = { [ChainId.ETH]: '0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E', [ChainId.OPTIMISM]: '0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E', [ChainId.SCROLL]: '0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E', + [ChainId.LINEA]: '0x34F52752975222d5994C206cE08C1d5B329f24dD', + [ChainId.BLAST]: '0x34F52752975222d5994C206cE08C1d5B329f24dD', + [ChainId.BSC]: '0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E', } diff --git a/packages/synapse-constants/constants/chains/master.ts b/packages/synapse-constants/constants/chains/master.ts index d1da6b3f52..41fd997bbb 100644 --- a/packages/synapse-constants/constants/chains/master.ts +++ b/packages/synapse-constants/constants/chains/master.ts @@ -19,6 +19,7 @@ import moonriverImg from '../assets/chains/moonriver.svg' import optimismImg from '../assets/chains/optimism.svg' import polygonImg from '../assets/chains/polygon.svg' import scrollImg from '../assets/chains/scroll.svg' +import lineaImg from '../assets/chains/linea.svg' import ethExplorerImg from '../assets/explorer/etherscan.svg' import arbitrumExplorerImg from '../assets/explorer/arbitrum.svg' import bnbExplorerImg from '../assets/explorer/bscscan.svg' @@ -40,6 +41,7 @@ import dogeExplorerImg from '../assets/explorer/dogechain.svg' import baseExplorerImg from '../assets/explorer/basescan.svg' import blastExplorerImg from '../assets/explorer/blast.svg' import scrollExplorerImg from '../assets/explorer/scroll.svg' +import lineaExplorerImg from '../assets/explorer/linea.svg' import { Chain } from '../types' export const ETH: Chain = { @@ -478,3 +480,27 @@ export const SCROLL: Chain = { }, color: 'orange', } + +export const LINEA: Chain = { + priorityRank: 90, + id: 59144, + chainSymbol: 'LINEA', + name: 'Linea', + codeName: 'linea', + chainImg: lineaImg, + layer: 2, + rpcUrls: { + primary: 'https://linea.blockpi.network/v1/rpc/public', + fallback: 'https://rpc.linea.build', + }, + explorerUrl: 'https://lineascan.build/', + explorerName: 'LineaScan', + explorerImg: lineaExplorerImg, + blockTime: 3000, + nativeCurrency: { + name: 'Ether', + symbol: 'ETH', + decimals: 18, + }, + color: 'black', +} diff --git a/packages/synapse-constants/constants/tokens/bridgeMap.ts b/packages/synapse-constants/constants/tokens/bridgeMap.ts index 8257707cf1..2f002e5c53 100644 --- a/packages/synapse-constants/constants/tokens/bridgeMap.ts +++ b/packages/synapse-constants/constants/tokens/bridgeMap.ts @@ -167,6 +167,13 @@ export const BRIDGE_MAP = { destination: ['VSTA'], swappable: [], }, + '0xAdF7C35560035944e805D98fF17d58CDe2449389': { + decimals: 18, + symbol: 'SPEC', + origin: ['SPEC'], + destination: ['SPEC'], + swappable: [], + }, '0xBAac2B4491727D78D2b78815144570b9f2Fe8899': { decimals: 18, symbol: 'DOG', @@ -1233,6 +1240,13 @@ export const BRIDGE_MAP = { '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', ], }, + '0x96419929d7949D6A801A6909c145C8EEf6A40431': { + decimals: 18, + symbol: 'SPEC', + origin: ['SPEC'], + destination: ['SPEC'], + swappable: [], + }, '0xEB466342C4d449BC9f53A865D5Cb90586f405215': { decimals: 6, symbol: 'axlUSDC', diff --git a/packages/synapse-constants/constants/tokens/bridgeable.ts b/packages/synapse-constants/constants/tokens/bridgeable.ts index 677e87af17..0b4e8ee7d8 100644 --- a/packages/synapse-constants/constants/tokens/bridgeable.ts +++ b/packages/synapse-constants/constants/tokens/bridgeable.ts @@ -412,6 +412,7 @@ export const USDC = new Token({ [CHAINS.BASE.id]: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', [CHAINS.POLYGON.id]: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359', [CHAINS.SCROLL.id]: '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4', + [CHAINS.LINEA.id]: '0x176211869cA2b568f2A7D4EE941E073a821EE1ff', }, decimals: { [CHAINS.ETH.id]: 6, @@ -428,6 +429,7 @@ export const USDC = new Token({ [CHAINS.BASE.id]: 6, [CHAINS.POLYGON.id]: 6, [CHAINS.SCROLL.id]: 6, + [CHAINS.LINEA.id]: 6, }, swapExceptions: { [CHAINS.KLAYTN.id]: [CHAINS.ETH.id, CHAINS.DOGE.id], @@ -785,6 +787,7 @@ export const ETH = new Token({ [CHAINS.DFK.id]: '0xfBDF0E31808d0aa7b9509AA6aBC9754E48C58852', [CHAINS.BLAST.id]: zeroAddress, [CHAINS.SCROLL.id]: nullAddress, + [CHAINS.LINEA.id]: nullAddress, }, decimals: 18, symbol: 'ETH', @@ -1225,6 +1228,7 @@ export const WETH = new Token({ [CHAINS.BASE.id]: '0x4200000000000000000000000000000000000006', [CHAINS.ARBITRUM.id]: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1', [CHAINS.BLAST.id]: '0x4300000000000000000000000000000000000004', + [CHAINS.LINEA.id]: '0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f', }, decimals: 18, symbol: 'WETH', diff --git a/packages/synapse-constants/constants/tokens/deprecated.ts b/packages/synapse-constants/constants/tokens/deprecated.ts index 7d62b34de2..6ff49c7566 100644 --- a/packages/synapse-constants/constants/tokens/deprecated.ts +++ b/packages/synapse-constants/constants/tokens/deprecated.ts @@ -1,7 +1,6 @@ import usdbLogo from '../assets/icons/usdc.svg' import fusdtLogo from '../assets/icons/usdt.svg' import { Token } from '../types' - import * as CHAINS from '../chains/master' export const USDB = new Token({ diff --git a/packages/synapse-constants/constants/tokens/swapMaster.ts b/packages/synapse-constants/constants/tokens/swapMaster.ts index 41b8ac16c7..e5a94bc9dd 100644 --- a/packages/synapse-constants/constants/tokens/swapMaster.ts +++ b/packages/synapse-constants/constants/tokens/swapMaster.ts @@ -1,7 +1,6 @@ import { Token } from '../types' import usdtLogo from '../assets/icons/usdt.svg' import usdcLogo from '../assets/icons/usdc.svg' - import * as CHAINS from '../chains/master' export const SwapUSDC = new Token({ diff --git a/packages/synapse-constants/package.json b/packages/synapse-constants/package.json index 2947d3dd9a..c8474b135b 100644 --- a/packages/synapse-constants/package.json +++ b/packages/synapse-constants/package.json @@ -1,6 +1,6 @@ { "name": "synapse-constants", - "version": "1.3.20", + "version": "1.3.21", "description": "This is an npm package that maintains all synapse constants", "main": "dist/index.js", "module": "dist/index.js", diff --git a/services/explorer/api/server_test.go b/services/explorer/api/server_test.go index 46f592d460..6a5a0b27df 100644 --- a/services/explorer/api/server_test.go +++ b/services/explorer/api/server_test.go @@ -57,6 +57,7 @@ func TestHandleJSONDailyStat(t *testing.T) { Base *float64 "json:\"base\" graphql:\"base\"" Blast *float64 "json:\"blast\" graphql:\"blast\"" Scroll *float64 "json:\"scroll\" graphql:\"scroll\"" + Linea *float64 "json:\"linea\" graphql:\"linea\"" Total *float64 "json:\"total\" graphql:\"total\"" }{ { diff --git a/services/explorer/graphql/client/client.go b/services/explorer/graphql/client/client.go index e74497cea3..04f5498f6d 100644 --- a/services/explorer/graphql/client/client.go +++ b/services/explorer/graphql/client/client.go @@ -128,6 +128,7 @@ type GetDailyStatisticsByChain struct { Base *float64 "json:\"base\" graphql:\"base\"" Blast *float64 "json:\"blast\" graphql:\"blast\"" Scroll *float64 "json:\"scroll\" graphql:\"scroll\"" + Linea *float64 "json:\"linea\" graphql:\"linea\"" Total *float64 "json:\"total\" graphql:\"total\"" } "json:\"response\" graphql:\"response\"" } @@ -500,6 +501,7 @@ const GetDailyStatisticsByChainDocument = `query GetDailyStatisticsByChain ($cha base blast scroll + linea total } } diff --git a/services/explorer/graphql/client/queries/queries.graphql b/services/explorer/graphql/client/queries/queries.graphql index 6359989738..60eb3d63eb 100644 --- a/services/explorer/graphql/client/queries/queries.graphql +++ b/services/explorer/graphql/client/queries/queries.graphql @@ -154,6 +154,7 @@ query GetDailyStatisticsByChain($chainID: Int, $type: DailyStatisticType, $durat base blast scroll + linea total } } diff --git a/services/explorer/graphql/server/graph/model/models_gen.go b/services/explorer/graphql/server/graph/model/models_gen.go index d5c7fda229..d3eeb60af4 100644 --- a/services/explorer/graphql/server/graph/model/models_gen.go +++ b/services/explorer/graphql/server/graph/model/models_gen.go @@ -103,6 +103,7 @@ type DateResultByChain struct { Base *float64 `json:"base,omitempty"` Blast *float64 `json:"blast,omitempty"` Scroll *float64 `json:"scroll,omitempty"` + Linea *float64 `json:"linea,omitempty"` Total *float64 `json:"total,omitempty"` } diff --git a/services/explorer/graphql/server/graph/partials.go b/services/explorer/graphql/server/graph/partials.go index 0e264eb5b7..85519e442b 100644 --- a/services/explorer/graphql/server/graph/partials.go +++ b/services/explorer/graphql/server/graph/partials.go @@ -400,6 +400,7 @@ const dailyVolumeBridgeMvPt1 = ` results[8453] AS base, results[81457] AS blast, results[534352] AS scroll, + results[59144] AS linea, arraySum(mapValues(results)) AS total FROM (SELECT date, maxMap(map(chain_id, total)) AS results FROM (SELECT coalesce(toString(b.date), toString(s.date)) AS date, @@ -443,6 +444,7 @@ const dailyVolumeBridge = ` results[8453] AS base, results[81457] AS blast, results[534352] AS scroll, + results[59144] AS linea, arraySum(mapValues(results)) AS total FROM (SELECT date, maxMap(map(chain_id, total)) AS results FROM (SELECT coalesce(toString(b.date), toString(s.date)) AS date, @@ -538,6 +540,7 @@ SELECT date, results[8453] AS base, results[81457] AS blast, results[534352] AS scroll, + results[59144] AS linea, arraySum(mapValues(results)) AS total FROM (SELECT date, maxMap(map(chain_id, total)) AS results FROM (SELECT coalesce(toString(b.date), toString(s.date), toString(m.date)) AS date, @@ -639,6 +642,7 @@ SELECT date, results[8453] AS base, results[81457] AS blast, results[534352] AS scroll, + results[59144] AS linea, arraySum(mapValues(results)) AS total FROM ( SELECT date, @@ -669,6 +673,7 @@ SELECT date, results[8453] AS base, results[81457] AS blast, results[534352] AS scroll, + results[59144] AS linea, arraySum(mapValues(results)) AS total FROM ( SELECT date, @@ -700,6 +705,7 @@ SELECT date, results[8453] AS base, results[81457] AS blast, results[534352] AS scroll, + results[59144] AS linea, arraySum(mapValues(results)) AS total FROM ( SELECT date, diff --git a/services/explorer/graphql/server/graph/resolver/server.go b/services/explorer/graphql/server/graph/resolver/server.go index 603fcf292d..8abe58001c 100644 --- a/services/explorer/graphql/server/graph/resolver/server.go +++ b/services/explorer/graphql/server/graph/resolver/server.go @@ -116,6 +116,7 @@ type ComplexityRoot struct { Fantom func(childComplexity int) int Harmony func(childComplexity int) int Klaytn func(childComplexity int) int + Linea func(childComplexity int) int Metis func(childComplexity int) int Moonbeam func(childComplexity int) int Moonriver func(childComplexity int) int @@ -603,6 +604,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.DateResultByChain.Klaytn(childComplexity), true + case "DateResultByChain.linea": + if e.complexity.DateResultByChain.Linea == nil { + break + } + + return e.complexity.DateResultByChain.Linea(childComplexity), true + case "DateResultByChain.metis": if e.complexity.DateResultByChain.Metis == nil { break @@ -1655,6 +1663,7 @@ type DateResultByChain { base: Float blast: Float scroll: Float + linea: Float total: Float } @@ -4782,6 +4791,47 @@ func (ec *executionContext) fieldContext_DateResultByChain_scroll(ctx context.Co return fc, nil } +func (ec *executionContext) _DateResultByChain_linea(ctx context.Context, field graphql.CollectedField, obj *model.DateResultByChain) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DateResultByChain_linea(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Linea, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*float64) + fc.Result = res + return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DateResultByChain_linea(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DateResultByChain", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _DateResultByChain_total(ctx context.Context, field graphql.CollectedField, obj *model.DateResultByChain) (ret graphql.Marshaler) { fc, err := ec.fieldContext_DateResultByChain_total(ctx, field) if err != nil { @@ -7138,6 +7188,8 @@ func (ec *executionContext) fieldContext_Query_dailyStatisticsByChain(ctx contex return ec.fieldContext_DateResultByChain_blast(ctx, field) case "scroll": return ec.fieldContext_DateResultByChain_scroll(ctx, field) + case "linea": + return ec.fieldContext_DateResultByChain_linea(ctx, field) case "total": return ec.fieldContext_DateResultByChain_total(ctx, field) } @@ -10380,6 +10432,8 @@ func (ec *executionContext) _DateResultByChain(ctx context.Context, sel ast.Sele out.Values[i] = ec._DateResultByChain_blast(ctx, field, obj) case "scroll": out.Values[i] = ec._DateResultByChain_scroll(ctx, field, obj) + case "linea": + out.Values[i] = ec._DateResultByChain_linea(ctx, field, obj) case "total": out.Values[i] = ec._DateResultByChain_total(ctx, field, obj) default: diff --git a/services/explorer/graphql/server/graph/schema/types.graphql b/services/explorer/graphql/server/graph/schema/types.graphql index c73749fad2..9b8bebdbd0 100644 --- a/services/explorer/graphql/server/graph/schema/types.graphql +++ b/services/explorer/graphql/server/graph/schema/types.graphql @@ -179,6 +179,7 @@ type DateResultByChain { base: Float blast: Float scroll: Float + linea: Float total: Float } diff --git a/services/explorer/static/chainIDs.yaml b/services/explorer/static/chainIDs.yaml index e68c334928..84add22b21 100644 --- a/services/explorer/static/chainIDs.yaml +++ b/services/explorer/static/chainIDs.yaml @@ -18,3 +18,4 @@ 8453: 'Base' 81457: 'Blast' 534352: 'Scroll' +59144: 'Linea'