Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supported Darwinia #11

Merged
merged 15 commits into from
Jul 11, 2024
23 changes: 14 additions & 9 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,21 @@ jobs:

- name: Build packages
# run: yarn g:build
run: |
yarn sdk @helix-bridge/universal-router-sdk build
# run: yarn sdk @helix-bridge/sdk-core build
# run: |
# yarn sdk @helix-bridge/v2-sdk build
# yarn sdk @helix-bridge/v3-sdk build
# run: yarn sdk @helix-bridge/router-sdk build
# run: yarn sdk @helix-bridge/uniswapx-sdk build
run: yarn sdk @helix-bridge/universal-router-sdk build

- name: Publish to GitHub Packages
run: |
npm publish -w @helix-bridge/universal-router-sdk
# npm publish -w @helix-bridge/uniswapx-sdk
# npm publish -w @helix-bridge/router-sdk
# npm publish -w @helix-bridge/v2-sdk
# npm publish -w @helix-bridge/v3-sdk
# npm publish -w @helix-bridge/sdk-core
# run: npm publish -w @helix-bridge/sdk-core
# run: |
# npm publish -w @helix-bridge/v2-sdk
# npm publish -w @helix-bridge/v3-sdk
# run: npm publish -w @helix-bridge/router-sdk
# run: npm publish -w @helix-bridge/uniswapx-sdk
run: npm publish -w @helix-bridge/universal-router-sdk
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
8 changes: 4 additions & 4 deletions sdks/router-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helix-bridge/router-sdk",
"version": "1.0.5",
"version": "1.1.0",
"description": "An sdk for routing swaps using Uniswap v2 and Uniswap v3.",
"repository": "https://github.com/Uniswap/sdks.git",
"keywords": [
Expand All @@ -22,9 +22,9 @@
},
"dependencies": {
"@ethersproject/abi": "^5.5.0",
"@helix-bridge/sdk-core": "1.0.5",
"@helix-bridge/v2-sdk": "1.0.5",
"@helix-bridge/v3-sdk": "1.0.5",
"@helix-bridge/sdk-core": "1.1.0",
"@helix-bridge/v2-sdk": "1.1.0",
"@helix-bridge/v3-sdk": "1.1.0",
"@uniswap/swap-router-contracts": "^1.3.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion sdks/sdk-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helix-bridge/sdk-core",
"version": "1.0.5",
"version": "1.1.0",
"description": "⚒️ An SDK for building applications on top of Uniswap V3",
"repository": "https://github.com/Uniswap/sdks.git",
"keywords": [
Expand Down
8 changes: 8 additions & 0 deletions sdks/sdk-core/src/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ const BITLAYER_ADDRESSES: ChainAddresses = {
nonfungiblePositionManagerAddress: '0xFBAD806Bdf9cEC2943be281FB355Da05068DE925',
}

const DARWINIA_ADDRESSES: ChainAddresses = {
v3CoreFactoryAddress: '0xF118eAEcCFc037986D08A6CBC97A4F2C8de9108e',
multicallAddress: '0xD1167316a70d5566ED18BCfe1e265D59338447bE',
quoterAddress: '0x54692837aC72A54d38069Ac6Ec8c4C56590e8679',
nonfungiblePositionManagerAddress: '0x00DEba7612403e8bDa0b82186548EE59C86CBf98',
}

export const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses> = {
[ChainId.MAINNET]: MAINNET_ADDRESSES,
[ChainId.OPTIMISM]: OPTIMISM_ADDRESSES,
Expand All @@ -274,6 +281,7 @@ export const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses>
[ChainId.BLAST]: BLAST_ADDRESSES,
[ChainId.BITLAYER_TESTNET]: BITLAYER_TESTNET_ADDRESSES,
[ChainId.BITLAYER]: BITLAYER_ADDRESSES,
[ChainId.DARWINIA]: DARWINIA_ADDRESSES,
}

/* V3 Contract Addresses */
Expand Down
5 changes: 5 additions & 0 deletions sdks/sdk-core/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export enum ChainId {
BLAST = 81457,
BITLAYER_TESTNET = 200810,
BITLAYER = 200901,
DARWINIA = 46,
}

export const SUPPORTED_CHAINS = [
Expand All @@ -50,6 +51,7 @@ export const SUPPORTED_CHAINS = [
ChainId.BLAST,
ChainId.BITLAYER_TESTNET,
ChainId.BITLAYER,
ChainId.DARWINIA,
] as const
export type SupportedChainsType = (typeof SUPPORTED_CHAINS)[number]

Expand All @@ -62,10 +64,13 @@ export enum NativeCurrencyName {
MOONBEAM = 'GLMR',
BNB = 'BNB',
AVAX = 'AVAX',
BTC = 'BTC',
RING = 'RING',
// ROOTSTOCK = 'RBTC',
}

export const CHAINS_SUPPORTED_BY_HELIXSWAP = [
ChainId.BITLAYER_TESTNET,
ChainId.BITLAYER,
ChainId.DARWINIA,
]
7 changes: 7 additions & 0 deletions sdks/sdk-core/src/entities/ether.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ import { NativeCurrency } from './nativeCurrency'
import { Token } from './token'
import { WETH9 } from './weth9'

/**
* Specify the symbol and name of specific chains
* @param chainId Chain ID of the chain
* @returns [Symbol, Name]
*/
function getSymbolAndName(chainId: number) {
switch (chainId) {
case 200810:
case 200901:
return ['BTC', 'BTC']
case 46:
return ['RING', 'RING']
default:
return ['ETH', 'Ether']
}
Expand Down
2 changes: 2 additions & 0 deletions sdks/sdk-core/src/entities/weth9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ export const WETH9: { [chainId: number]: Token } = {
200810: new Token(200810, '0x5F8D4232367759bCe5d9488D3ade77FCFF6B9b6B', 18, 'WBTC', 'Wrapped BTC'),
// Bitlayer
200901: new Token(200901, '0xfF204e2681A6fA0e2C3FaDe68a1B28fb90E4Fc5F', 18, 'WBTC', 'Wrapped BTC'),
// Darwinia
46: new Token(46, '0xE7578598Aac020abFB918f33A20faD5B71d670b4', 18, 'WRING', 'Wrapped RING'),
}
2 changes: 1 addition & 1 deletion sdks/uniswapx-sdk/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@ethersproject/bytes": "^5.7.0",
"@helix-bridge/sdk-core": "1.0.1",
"@helix-bridge/sdk-core": "1.1.0",
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^6.1.2",
"ethers": "^5.7.0",
Expand Down
4 changes: 2 additions & 2 deletions sdks/uniswapx-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helix-bridge/uniswapx-sdk",
"version": "1.0.5",
"version": "1.1.0",
"author": "Uniswap",
"repository": "https://github.com/Uniswap/sdks.git",
"keywords": [
Expand Down Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@helix-bridge/sdk-core": "1.0.5",
"@helix-bridge/sdk-core": "1.1.0",
"@uniswap/permit2-sdk": "^1.2.1",
"ethers": "^5.7.0"
},
Expand Down
10 changes: 5 additions & 5 deletions sdks/universal-router-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helix-bridge/universal-router-sdk",
"version": "1.0.5",
"version": "1.1.0",
"description": "sdk for integrating with the Universal Router contracts",
"repository": "https://github.com/Uniswap/sdks.git",
"keywords": [
Expand Down Expand Up @@ -31,10 +31,10 @@
"test:hardhat": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' hardhat test"
},
"dependencies": {
"@helix-bridge/router-sdk": "1.0.5",
"@helix-bridge/sdk-core": "1.0.5",
"@helix-bridge/v2-sdk": "1.0.5",
"@helix-bridge/v3-sdk": "1.0.5",
"@helix-bridge/router-sdk": "1.1.0",
"@helix-bridge/sdk-core": "1.1.0",
"@helix-bridge/v2-sdk": "1.1.0",
"@helix-bridge/v3-sdk": "1.1.0",
"@uniswap/permit2-sdk": "^1.2.1",
"@uniswap/universal-router": "1.6.0",
"bignumber.js": "^9.0.2",
Expand Down
8 changes: 7 additions & 1 deletion sdks/universal-router-sdk/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ const CHAIN_CONFIGS: { [key: number]: ChainConfig } = {
router: '0x0ac58df0cc3542bec4cda71b16d06c3ccc39f405',
weth: '0xfF204e2681A6fA0e2C3FaDe68a1B28fb90E4Fc5F',
creationBlock: 2753030,
}
},
// darwinia
[46]: {
router: '0xF8cD37bfC0f8a377b8A82C574c1bC4370EDc480B',
weth: '0xE7578598Aac020abFB918f33A20faD5B71d670b4',
creationBlock: 3087706,
},
}

export const UNIVERSAL_ROUTER_ADDRESS = (chainId: number): string => {
Expand Down
4 changes: 2 additions & 2 deletions sdks/v2-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helix-bridge/v2-sdk",
"version": "1.0.5",
"version": "1.1.0",
"description": "🛠 An SDK for building applications on top of Uniswap V2",
"repository": "https://github.com/Uniswap/sdks.git",
"keywords": [
Expand All @@ -27,7 +27,7 @@
"dependencies": {
"@ethersproject/address": "^5.0.2",
"@ethersproject/solidity": "^5.0.9",
"@helix-bridge/sdk-core": "1.0.5",
"@helix-bridge/sdk-core": "1.1.0",
"tiny-invariant": "^1.1.0",
"tiny-warning": "^1.0.3"
},
Expand Down
4 changes: 2 additions & 2 deletions sdks/v3-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helix-bridge/v3-sdk",
"version": "1.0.5",
"version": "1.1.0",
"description": "⚒️ An SDK for building applications on top of Uniswap V3",
"repository": "https://github.com/Uniswap/sdks.git",
"keywords": [
Expand All @@ -27,7 +27,7 @@
"dependencies": {
"@ethersproject/abi": "^5.5.0",
"@ethersproject/solidity": "^5.0.9",
"@helix-bridge/sdk-core": "1.0.5",
"@helix-bridge/sdk-core": "1.1.0",
"@uniswap/swap-router-contracts": "^1.3.0",
"@uniswap/v3-periphery": "^1.1.1",
"@uniswap/v3-staker": "1.0.0",
Expand Down
Loading