Skip to content

Commit

Permalink
Adding JEWEL support for Metis and ETH (#2310)
Browse files Browse the repository at this point in the history
* adding jewel to widget constants and interface

* fixing versioning in accordance with GA
  • Loading branch information
Defi-Moses authored Mar 18, 2024
1 parent c6d07aa commit 0638fd5
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 11 deletions.
29 changes: 25 additions & 4 deletions packages/synapse-constants/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Synapse Constants
[![npm](https://img.shields.io/npm/v/%40synapsecns%2Fsdk-router?style=flat-square)](https://www.npmjs.com/package/@synapsecns/sdk-router)

[![npm](https://img.shields.io/npm/v/synapse-constants?style=flat-square)](https://www.npmjs.com/package/synapse-constants)

This package contains the Synapse Protocol Token and Chain Constants

Expand All @@ -12,20 +11,42 @@ This package contains the Synapse Protocol Token and Chain Constants
## Installation

```bash
npm install synapse-constants/dist
npm install synapse-constants
```

With Yarn:

```bash
yarn add synapse-constants/dist
yarn add synapse-constants
```

## Usage


To restrict the assets and chains that are imported, you can create a "custom bridge list". From the set of all tokens imported from "bridgeable.ts" you can import specific tokens and use that as the custom list you use in your application. The same can be done for chains

## Usage
For maintenance, when new tokens are added to the bridge the following steps should be taken.

1. Regenerate bridgeMaps.ts

```bash
yarn maps:generate
```

2. Update Bridgeable.ts with the new token addresses (check all other variables like decimals/ symbols etc. )

3. Repackage and webpack all of the data

```bash
yarn compile
```

4. Republish the npm package (make sure to update the version)

```bash
npm publish
```


TODO:
Expand Down
14 changes: 14 additions & 0 deletions packages/synapse-constants/constants/bridgeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export const BRIDGE_MAP = {
destination: ['SYN'],
swappable: [],
},
'0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e': {
decimals: 18,
symbol: 'JEWEL',
origin: ['JEWEL'],
destination: ['JEWEL'],
swappable: [],
},
'0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F': {
decimals: 18,
symbol: 'nUSD',
Expand Down Expand Up @@ -795,6 +802,13 @@ export const BRIDGE_MAP = {
},
},
'1088': {
'0x17C09cfC96C865CF546d73365Cedb6dC66986963': {
decimals: 18,
symbol: 'JEWEL',
origin: ['JEWEL'],
destination: ['JEWEL'],
swappable: [],
},
'0x420000000000000000000000000000000000000A': {
decimals: 18,
symbol: 'WETH',
Expand Down
14 changes: 14 additions & 0 deletions packages/synapse-constants/constants/tokens/bridgeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export const BRIDGE_MAP = {
destination: ['SYN'],
swappable: [],
},
'0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e': {
decimals: 18,
symbol: 'JEWEL',
origin: ['JEWEL'],
destination: ['JEWEL'],
swappable: [],
},
'0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F': {
decimals: 18,
symbol: 'nUSD',
Expand Down Expand Up @@ -795,6 +802,13 @@ export const BRIDGE_MAP = {
},
},
'1088': {
'0x17C09cfC96C865CF546d73365Cedb6dC66986963': {
decimals: 18,
symbol: 'JEWEL',
origin: ['JEWEL'],
destination: ['JEWEL'],
swappable: [],
},
'0x420000000000000000000000000000000000000A': {
decimals: 18,
symbol: 'WETH',
Expand Down
2 changes: 2 additions & 0 deletions packages/synapse-constants/constants/tokens/bridgeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ export const JEWEL = new Token({
[CHAINS.HARMONY.id]: '0x72cb10c6bfa5624dd07ef608027e366bd690048f',
[CHAINS.KLAYTN.id]: '0x30C103f8f5A3A732DFe2dCE1Cc9446f545527b43',
[CHAINS.AVALANCHE.id]: '0x997Ddaa07d716995DE90577C123Db411584E5E46',
[CHAINS.METIS.id]: '0x17C09cfC96C865CF546d73365Cedb6dC66986963',
[CHAINS.ETH.id]: '0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e',
},
decimals: 18,
symbol: 'JEWEL',
Expand Down
8 changes: 4 additions & 4 deletions packages/synapse-constants/data/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"10": "https://mainnet.optimism.io",
"25": "https://evm.cronos.org",
"56": "https://bsc.publicnode.com",
"137": "https://polygon-rpc.com",
"250": "https://fantom-pokt.nodies.app",
"137": "https://polygon-bor.publicnode.com",
"250": "https://rpc3.fantom.network",
"288": "https://replica.boba.network",
"1088": "https://andromeda.metis.io/?owner=1088",
"1284": "https://moonbeam.public.blastapi.io",
"1285": "https://moonriver.public.blastapi.io",
"2000": "https://rpc.dogechain.dog",
"7700": "https://mainnode.plexnode.org:8545",
"81457": "https://rpc.blast.io",
"8217": "https://klaytn-pokt.nodies.app",
"8453": "https://developer-access-mainnet.base.org",
"42161": "https://arbitrum-one.public.blastapi.io",
"81457": "https://lingering-indulgent-replica.blast-mainnet.quiknode.pro/6667a8f4be701cb6549b415d567bc706fb2f13a8",
"42161": "https://arbitrum-one.publicnode.com",
"43114": "https://api.avax.network/ext/bc/C/rpc",
"53935": "https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc",
"1313161554": "https://mainnet.aurora.dev",
Expand Down
5 changes: 3 additions & 2 deletions packages/synapse-constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lint:check": "eslint . --max-warnings=0",
"build": "node scripts/generateMaps.js && node scripts/findMissing.js",
"prepublish": "tsc",
"compile": "tsc && copyfiles -u 1 \"constants/assets/**/*.*\" dist/constants && webpack"
"compile": "tsc && copyfiles -u 1 \"constants/assets/**/*.*\" dist/constants && webpack",
"maps:generate": "yarn build && yarn compile"
},
"author": "",
"license": "ISC",
Expand All @@ -44,4 +45,4 @@
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
}
}
}
1 change: 1 addition & 0 deletions packages/synapse-constants/scripts/generateMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ const printMaps = async () => {
console.log('Finished chain: ', chainId)
})
)
prettyPrintTS(bridgeMap, 'BRIDGE_MAP', './constants/tokens/bridgeMap.ts')
prettyPrintTS(bridgeMap, 'BRIDGE_MAP', './constants/bridgeMap.ts')
}

Expand Down
14 changes: 14 additions & 0 deletions packages/synapse-interface/constants/bridgeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export const BRIDGE_MAP = {
destination: ['SYN'],
swappable: [],
},
'0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e': {
decimals: 18,
symbol: 'JEWEL',
origin: ['JEWEL'],
destination: ['JEWEL'],
swappable: [],
},
'0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F': {
decimals: 18,
symbol: 'nUSD',
Expand Down Expand Up @@ -795,6 +802,13 @@ export const BRIDGE_MAP = {
},
},
'1088': {
'0x17C09cfC96C865CF546d73365Cedb6dC66986963': {
decimals: 18,
symbol: 'JEWEL',
origin: ['JEWEL'],
destination: ['JEWEL'],
swappable: [],
},
'0x420000000000000000000000000000000000000A': {
decimals: 18,
symbol: 'WETH',
Expand Down
2 changes: 2 additions & 0 deletions packages/synapse-interface/constants/tokens/bridgeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,8 @@ export const JEWEL = new Token({
[CHAINS.HARMONY.id]: '0x72cb10c6bfa5624dd07ef608027e366bd690048f',
[CHAINS.KLAYTN.id]: '0x30C103f8f5A3A732DFe2dCE1Cc9446f545527b43',
[CHAINS.AVALANCHE.id]: '0x997Ddaa07d716995DE90577C123Db411584E5E46',
[CHAINS.METIS.id]: '0x17C09cfC96C865CF546d73365Cedb6dC66986963',
[CHAINS.ETH.id]: '0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e',
},
decimals: 18,
symbol: 'JEWEL',
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@
"lodash": "^4.17.21",
"react-redux": "^9.0.2"
}
}
}
14 changes: 14 additions & 0 deletions packages/widget/src/constants/bridgeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export const BRIDGE_MAP = {
destination: ['SYN'],
swappable: [],
},
'0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e': {
decimals: 18,
symbol: 'JEWEL',
origin: ['JEWEL'],
destination: ['JEWEL'],
swappable: [],
},
'0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F': {
decimals: 18,
symbol: 'nUSD',
Expand Down Expand Up @@ -795,6 +802,13 @@ export const BRIDGE_MAP = {
},
},
'1088': {
'0x17C09cfC96C865CF546d73365Cedb6dC66986963': {
decimals: 18,
symbol: 'JEWEL',
origin: ['JEWEL'],
destination: ['JEWEL'],
swappable: [],
},
'0x420000000000000000000000000000000000000A': {
decimals: 18,
symbol: 'WETH',
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 @@ -904,12 +904,16 @@ export const JEWEL: BridgeableToken = {
[CHAINS.HARMONY.id]: '0x72cb10c6bfa5624dd07ef608027e366bd690048f',
[CHAINS.KLAYTN.id]: '0x30C103f8f5A3A732DFe2dCE1Cc9446f545527b43',
[CHAINS.AVALANCHE.id]: '0x997Ddaa07d716995DE90577C123Db411584E5E46',
[CHAINS.METIS.id]: '0x17C09cfC96C865CF546d73365Cedb6dC66986963',
[CHAINS.ETHEREUM.id]: '0x12f79f8c1A6e47a9b5F0796FDb008Bdc182fa19e',
},
decimals: {
[CHAINS.DFK.id]: 18,
[CHAINS.HARMONY.id]: 18,
[CHAINS.KLAYTN.id]: 18,
[CHAINS.AVALANCHE.id]: 18,
[CHAINS.METIS.id]: 18,
[CHAINS.ETHEREUM.id]: 18,
},
symbol: 'JEWEL',
name: 'JEWEL',
Expand Down

0 comments on commit 0638fd5

Please sign in to comment.