Skip to content

Commit

Permalink
Adds Linea (#2983)
Browse files Browse the repository at this point in the history
  • Loading branch information
abtestingalpha authored Aug 6, 2024
1 parent ef9ec3f commit 353aafc
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/widget/examples/with-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@synapsecns/widget": "^0.1.0",
"@synapsecns/widget": "^0.6.3",
"ethers": "^6.9.1",
"next": "14.0.4",
"react": "^18",
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/examples/with-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@synapsecns/widget": "0.1.0",
"@synapsecns/widget": "0.6.3",
"@types/node": "^16.18.65",
"@types/react": "^18.2.39",
"@types/react-dom": "^18.2.17",
Expand Down
60 changes: 52 additions & 8 deletions packages/widget/src/constants/bridgeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,36 @@ export const BRIDGE_MAP = {
swappable: [],
},
},
'59144': {
'0x176211869cA2b568f2A7D4EE941E073a821EE1ff': {
decimals: 6,
symbol: 'USDC',
origin: ['RFQ.USDC'],
destination: ['RFQ.USDC'],
swappable: ['0xA219439258ca9da29E9Cc4cE5596924745e12B93'],
},
'0xA219439258ca9da29E9Cc4cE5596924745e12B93': {
decimals: 6,
symbol: 'USDT',
origin: ['RFQ.USDC'],
destination: [],
swappable: ['0x176211869cA2b568f2A7D4EE941E073a821EE1ff'],
},
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': {
decimals: 18,
symbol: 'ETH',
origin: ['RFQ.ETH'],
destination: ['RFQ.ETH'],
swappable: [],
},
'0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f': {
decimals: 18,
symbol: 'WETH',
origin: ['RFQ.ETH'],
destination: [],
swappable: [],
},
},
'81457': {
'0x3194B0A295D87fDAA54DF852c248F7a6BAF6c6e0': {
decimals: 18,
Expand All @@ -1811,7 +1841,7 @@ export const BRIDGE_MAP = {
'0x4300000000000000000000000000000000000004': {
decimals: 18,
symbol: 'WETH',
origin: ['nETH'],
origin: ['RFQ.ETH', 'nETH'],
destination: ['nETH'],
swappable: [
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
Expand All @@ -1828,8 +1858,8 @@ export const BRIDGE_MAP = {
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': {
decimals: 18,
symbol: 'ETH',
origin: ['nETH'],
destination: ['nETH'],
origin: ['RFQ.ETH', 'nETH'],
destination: ['nETH', 'RFQ.ETH'],
swappable: [
'0x4300000000000000000000000000000000000004',
'0xce971282fAAc9faBcF121944956da7142cccC855',
Expand All @@ -1838,7 +1868,7 @@ export const BRIDGE_MAP = {
'0xce971282fAAc9faBcF121944956da7142cccC855': {
decimals: 18,
symbol: 'nETH',
origin: ['nETH'],
origin: ['RFQ.ETH', 'nETH'],
destination: ['nETH'],
swappable: [
'0x4300000000000000000000000000000000000004',
Expand All @@ -1848,18 +1878,32 @@ export const BRIDGE_MAP = {
},
'534352': {
'0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4': {
decimals: 6,
symbol: 'USDC',
origin: ['RFQ.USDC'],
destination: ['RFQ.USDC'],
swappable: ['0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df'],
},
'0x5300000000000000000000000000000000000004': {
decimals: 18,
symbol: 'WETH',
origin: ['RFQ.ETH'],
destination: [],
swappable: [],
symbol: 'USDC',
decimals: 6,
},
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': {
decimals: 18,
symbol: 'ETH',
origin: ['RFQ.ETH'],
destination: ['RFQ.ETH'],
swappable: [],
symbol: 'ETH',
decimals: 18,
},
'0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df': {
decimals: 6,
symbol: 'USDT',
origin: ['RFQ.USDC'],
destination: [],
swappable: ['0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4'],
},
},
'1313161554': {
Expand Down
4 changes: 4 additions & 0 deletions packages/widget/src/constants/bridgeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ export const USDC: BridgeableToken = {
[CHAINS.BASE.id]: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
[CHAINS.POLYGON.id]: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',
[CHAINS.SCROLL.id]: '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4',
[CHAINS.LINEA.id]: '0x176211869cA2b568f2A7D4EE941E073a821EE1ff',
},
decimals: {
[CHAINS.ETHEREUM.id]: 6,
Expand All @@ -452,6 +453,7 @@ export const USDC: BridgeableToken = {
[CHAINS.BASE.id]: 6,
[CHAINS.POLYGON.id]: 6,
[CHAINS.SCROLL.id]: 6,
[CHAINS.LINEA.id]: 6,
},
symbol: 'USDC',
name: 'USD Coin',
Expand Down Expand Up @@ -802,6 +804,7 @@ export const ETH: BridgeableToken = {
[CHAINS.DFK.id]: '0xfBDF0E31808d0aa7b9509AA6aBC9754E48C58852',
[CHAINS.BLAST.id]: ZeroAddress,
[CHAINS.SCROLL.id]: ZeroAddress,
[CHAINS.LINEA.id]: ZeroAddress,
},
decimals: {
[CHAINS.ETHEREUM.id]: 18,
Expand All @@ -813,6 +816,7 @@ export const ETH: BridgeableToken = {
[CHAINS.DFK.id]: 18,
[CHAINS.BLAST.id]: 18,
[CHAINS.SCROLL.id]: 18,
[CHAINS.LINEA.id]: 18,
},
symbol: 'ETH',
name: 'Ethereum',
Expand Down
22 changes: 22 additions & 0 deletions packages/widget/src/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,27 @@ export const SCROLL: Chain = {
},
}

export const LINEA: Chain = {
id: 59144,
name: 'Linea',
rpcUrls: {
primary: 'https://rpc.linea.build',
fallback: 'https://linea.blockpi.network/v1/rpc/public',
},
explorerUrl: 'https://lineascan.build',
explorerName: 'LineaScan',
blockTime: 3000,
imgUrl:
'https://master.sanguine-fe.pages.dev/_next/static/media/linea.e476f2ad.svg',
networkName: 'Linea',
networkUrl: 'https://rpc.linea.build',
nativeCurrency: {
name: 'Ethereum',
symbol: 'ETH',
decimals: 18,
},
}

export const CHAINS = {
ETHEREUM,
ARBITRUM,
Expand All @@ -465,6 +486,7 @@ export const CHAINS = {
BASE,
BLAST,
SCROLL,
LINEA,
}

export const CHAINS_ARRAY = Object.values(CHAINS)
Expand Down

0 comments on commit 353aafc

Please sign in to comment.